diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 2822cfb..cabf3d7 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -49,9 +49,36 @@ jobs: - name: Run pre-commit gc run: pipx run pre-commit gc + tests: + name: "Tests" + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + # https://github.com/actions/checkout + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Set up Python + # https://github.com/actions/setup-python + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 + id: setup-py + with: + cache: 'pipenv' + python-version: "3.12" + + - name: Install pipenv + run: pipx install pipenv + + - name: Install dependencies + run: pipenv install --dev + + - name: Run tests + run: pipenv run pytest -v + + container: name: "Build (and push) container image" - needs: [pre-commit] + needs: [pre-commit, tests] runs-on: ubuntu-latest permissions: contents: read @@ -111,6 +138,8 @@ jobs: # Effect on build times (B&P step only): # No caching: 44s # Max mode, no cache: 79s + # Max mode, changed deps: 61s + # Max mode, changed code: # Max mode, perfect hit: 8s cache-from: type=gha cache-to: type=gha,mode=max @@ -121,7 +150,7 @@ jobs: # - for branch protection rules ci-success: name: CI Workflow - Success - needs: [pre-commit, container] + needs: [container, pre-commit, tests] runs-on: ubuntu-latest steps: - name: Success