FastAPI CRUD #336
This file contains 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: FastAPI CRUD | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'fastapi-crud/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'fastapi-crud/**' | |
schedule: | |
# Every week at 00 UTC. | |
- cron: "0 0 * * 0" | |
# If you trigger a new workflow while the previous one is running, | |
# this will cancel the previous one. | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
working-directory: ./fastapi-crud | |
jobs: | |
run-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Use matrix strategy to run the tests on multiple Py versions on multiple OSs. | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10"] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install the dependencies | |
run: | | |
echo "Installing the dependencies..." | |
make setup | |
- name: Check linter | |
run: | | |
echo "Checking linter formatting..." | |
make lint-check | |
- name: Run healthcheck | |
run: | | |
echo "Running healthcheck..." | |
make health-check | |
- name: Test | |
run: | | |
echo "Running automated tests..." | |
make test |