From c783be515551be89423040dc19b11f4d06812081 Mon Sep 17 00:00:00 2001 From: phil Date: Sun, 3 Nov 2024 02:33:57 +0100 Subject: [PATCH] Reduce container size --- .containerignore | 3 +++ .forgejo/workflows/test.yaml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .forgejo/workflows/test.yaml diff --git a/.containerignore b/.containerignore index 81d15c4..5724d4f 100644 --- a/.containerignore +++ b/.containerignore @@ -1,2 +1,5 @@ .venv .git +dist +.pytest_cache +.forgejo diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml new file mode 100644 index 0000000..a3831c1 --- /dev/null +++ b/.forgejo/workflows/test.yaml @@ -0,0 +1,34 @@ +on: + push: + workflow_dispatch: + inputs: + verbose: + description: "Verbose" + required: false + default: false + type: boolean + +jobs: + test: + runs-on: container + container: + image: tiptop:5000/treetrail-backend-ci + volumes: + - "uv_cache:/root/.cache/uv" + - "ca-cert:/etc/containers/certs.d" + services: + treetrail-database: + image: treetrail-database + steps: + - name: Echo env + if: ${{ inputs.verbose }} + run: | + echo '${{ toJSON(env) }}' + + - uses: actions/checkout@v4 + + - name: Install app with 'uv pip install' + run: uv pip install --python=$UV_PROJECT_ENVIRONMENT --no-deps . + + - name: Run tests (API call) + run: pytest -s tests/basic.py