diff --git a/.github/actions/setup_project/action.yml b/.github/actions/setup_project/action.yml index b7eebd09..6bc1e130 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') }}-${{ env.CACHE_SUFFIX }} + 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') }}-${{ env.CACHE_SUFFIX }} + 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 9b3b0f63..2442277d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,9 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - uses: ./.github/actions/setup_project + env: + # To avoid race conditions on environment cache + CACHE_SUFFIX: ${{ matrix.pytest-mark }} - name: Run tests run: uv run coverage run -m pytest -m "${{ matrix.pytest-mark }}" - name: Generate coverage report