Update GitHub Actions and Implement Build Caching for CI/CD Workflows #211
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python checks | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
flake8-lint: | |
runs-on: ubuntu-latest | |
name: Lint | |
steps: | |
- name: Check out source repository | |
uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Cache pip dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
# Key includes Python version and requirements file hash | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: pip install flake8 | |
- name: flake8 Lint | |
uses: py-actions/flake8@v2 | |
with: | |
path: backend |