Skip to content

Commit

Permalink
ci: Add pip/npm cache in workflows (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev authored Oct 1, 2024
1 parent 5eade98 commit dd36327
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
paths:
- 'src/**'
- 'tests/**'
- pyproject.toml
- Makefile
- requirements*.txt
- .github/workflows/backend.yml
- 'pyproject.toml'
- 'Makefile'
- 'requirements*.txt'
- '.github/workflows/backend.yml'

permissions:
contents: read
Expand All @@ -20,7 +20,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: '3.12'
cache: 'pip'
- name: Lint backend
run: |
python -m pip install --upgrade pip
Expand All @@ -34,7 +35,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: '3.12'
cache: 'pip'
- name: Build frontend and share library
shell: bash
run: make build-frontend
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Lint frontend
run: |
cd frontend
Expand All @@ -35,7 +37,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Test frontend
run: |
cd frontend
Expand All @@ -55,7 +59,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
shell: bash
run: make build-frontend
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: '3.12'
cache: 'pip'
- name: Lint all files
run: |
python -m pip install --upgrade pip
Expand Down

0 comments on commit dd36327

Please sign in to comment.