Marc Cataford
5b600f0cb7
* perf(backend): cache .venv path correctly * perf(frontend): cache .yarn and .parcel-cache path correctly
89 lines
2.5 KiB
YAML
89 lines
2.5 KiB
YAML
name: Backend Pipeline
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
env:
|
|
TASK_VERSION: 3.28.0
|
|
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
name: Setup
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: get-python-version
|
|
run: |
|
|
echo "python_version=$(cat .python-version)" >> $GITHUB_OUTPUT
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ steps.get-python-version.outputs.python_version }}
|
|
- uses: actions/cache@v3
|
|
id: cache-restore
|
|
with:
|
|
path: |
|
|
backend/.venv
|
|
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}-${{ steps.get-python-version.outputs.python_version }}
|
|
- name: Install dependencies
|
|
if: steps.cache-restore.outputs.cache-hit != 'true'
|
|
run: . script/bootstrap
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: Lint
|
|
needs: setup
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: get-python-version
|
|
run: |
|
|
echo "python_version=$(cat .python-version)" >> $GITHUB_OUTPUT
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ steps.get-python-version.outputs.python_version }}
|
|
- name: Setup Task
|
|
uses: arduino/setup-task@v1
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
- uses: actions/cache@v3
|
|
id: cache-restore
|
|
with:
|
|
path: |
|
|
backend/.venv
|
|
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}-${{ steps.get-python-version.outputs.python_version }}
|
|
- name: Lint
|
|
run: |
|
|
task be:lint
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
name: Test
|
|
needs: setup
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: get-python-version
|
|
run: |
|
|
echo "python_version=$(cat .python-version)" >> $GITHUB_OUTPUT
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ steps.get-python-version.outputs.python_version }}
|
|
- name: Setup Task
|
|
uses: arduino/setup-task@v1
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
- uses: actions/cache@v3
|
|
id: cache-restore
|
|
with:
|
|
path: |
|
|
backend/.venv
|
|
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}-${{ steps.get-python-version.outputs.python_version }}
|
|
- name: Test
|
|
run: |
|
|
task be:test
|