From c79034b12bddc6538b98366e715911e77f15a649 Mon Sep 17 00:00:00 2001 From: Marius Lie Winger <89073985+mariuswinger@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:33:45 +0100 Subject: [PATCH] ci: run unit tests outside of docker --- .github/workflows/tests.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3abb3c1d..dcc9ac75 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,19 +18,24 @@ env: jobs: api-unit-tests: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./api steps: - - uses: actions/checkout@v4 + - name: "Setup: checkout repository" + uses: actions/checkout@v4 - - name: Login to image registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + - name: "Setup: install poetry" + run: pipx install poetry - - name: Build API image - run: | - docker pull $API_IMAGE - docker build --target development --tag api-development ./api # TODO: --cache-from $API_IMAGE + - name: "Setup: add python" + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "poetry" - - name: Pytest Unit tests - run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pytest --unit + - name: "Run: pytest unit tests" + run: poetry run pytest --unit api-integration-tests: runs-on: ubuntu-latest