diff --git a/.github/actions/setup_project/action.yml b/.github/actions/setup_project/action.yml index b7eebd090..3861d5563 100644 --- a/.github/actions/setup_project/action.yml +++ b/.github/actions/setup_project/action.yml @@ -21,10 +21,22 @@ runs: with: python-version-file: ".python-version" + - name: Restore cached virtualenv + uses: actions/cache/restore@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles(".python-version") }}-${{ hashFiles("pyproject.toml") }} + path: .venv + - name: Install dependencies run: uv run ./manage.py install_xapian shell: bash + - name: Save cached virtualenv + uses: actions/cache/save@v4 + with: + key: venv-${{ runner.os }}-${{ hashFiles(".python-version") }}-${{ hashFiles("pyproject.toml") }} + path: .venv + - name: Compile gettext messages run: uv run ./manage.py compilemessages shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b3b0f632..edb277a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,17 +18,24 @@ jobs: with: extra_args: --all-files + setup: + name: Setup project for testing + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + - uses: ./.github/actions/setup_project + - name: Run tests + tests: name: Run tests and generate coverage report + needs: setup runs-on: ubuntu-latest strategy: fail-fast: false # don't interrupt the other test processes matrix: pytest-mark: [slow, not slow] steps: - - name: Check out repository - uses: actions/checkout@v4 - - uses: ./.github/actions/setup_project - name: Run tests run: uv run coverage run -m pytest -m "${{ matrix.pytest-mark }}" - name: Generate coverage report