mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-10 09:01:14 +00:00
Add caching for virtualenv
This commit is contained in:
parent
0c4d72e17a
commit
cbe42d3a60
12
.github/actions/setup_project/action.yml
vendored
12
.github/actions/setup_project/action.yml
vendored
@ -21,10 +21,22 @@ runs:
|
|||||||
with:
|
with:
|
||||||
python-version-file: ".python-version"
|
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
|
- name: Install dependencies
|
||||||
run: uv run ./manage.py install_xapian
|
run: uv run ./manage.py install_xapian
|
||||||
shell: bash
|
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
|
- name: Compile gettext messages
|
||||||
run: uv run ./manage.py compilemessages
|
run: uv run ./manage.py compilemessages
|
||||||
shell: bash
|
shell: bash
|
||||||
|
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -29,6 +29,9 @@ jobs:
|
|||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup_project
|
- uses: ./.github/actions/setup_project
|
||||||
|
env:
|
||||||
|
# To avoid race conditions on environment cache
|
||||||
|
CACHE_SUFFIX: ${{ matrix.pytest-mark }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: uv run coverage run -m pytest -m "${{ matrix.pytest-mark }}"
|
run: uv run coverage run -m pytest -m "${{ matrix.pytest-mark }}"
|
||||||
- name: Generate coverage report
|
- name: Generate coverage report
|
||||||
|
Loading…
Reference in New Issue
Block a user