Skip to content

Commit

Permalink
Caching of Python deps in CI.
Browse files Browse the repository at this point in the history
Special care taken of python-poetry/poetry#2117
  • Loading branch information
dokterbob committed Aug 28, 2024
1 parent 242e8e1 commit 3ed0e77
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ jobs:
with:
node-version: '16.15.0'
cache: 'pnpm'
- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-1.8.3-0
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Set up Python
id: python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install Poetry
run: pip install poetry
python-version: 3.9
cache: poetry
cache-dependency-path: backend/poetry.lock
- name: Set Poetry environment
run: poetry -C ./backend env use '${{ steps.python.outputs.python-path }}'
- name: Install Python dependencies
run: poetry -C ./backend install --with tests
- name: Install JS dependencies
run: pnpm install --no-frozen-lockfile
- name: Build UI
run: pnpm run buildUi
- name: Lint UI
run: pnpm run lintUi
- name: Install Python dependencies
run: poetry install -C ./backend --with tests
- name: Run tests
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ jobs:
working-directory: ./backend
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
id: python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install Poetry
run: pip install poetry
python-version: 3.9
cache: poetry
cache-dependency-path: backend/poetry.lock
- name: Set Poetry environment
run: poetry env use '${{ steps.python.outputs.python-path }}'
- name: Install dependencies
run: poetry install --with tests --with mypy --with custom-data
- name: Run Mypy
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ jobs:
working-directory: ./backend
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
id: python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Poetry
run: pip install poetry
cache: poetry
cache-dependency-path: backend/poetry.lock
- name: Set Poetry environment
run: poetry env use '${{ steps.python.outputs.python-path }}'
- name: Install dependencies
run: poetry install --with tests --with mypy --with custom-data
- name: Run Pytest
Expand Down

0 comments on commit 3ed0e77

Please sign in to comment.