-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 1.68 KB
/
Copy pathbackend-ci.yml
File metadata and controls
70 lines (59 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
name: Backend CI
on:
push:
branches: [main]
paths:
- 'apps/api/**'
- '.github/workflows/backend-ci.yml'
pull_request:
paths:
- 'apps/api/**'
- '.github/workflows/backend-ci.yml'
jobs:
backend-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Setup Poetry cache
uses: actions/cache@v4
with:
path: |
apps/api/.venv
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('apps/api/pyproject.toml', 'apps/api/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Setup pre-commit cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('apps/api/.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Setup environment file
run: |
cp src/config/.env.example src/config/.env || true
echo "ENV=test" >> src/config/.env
- name: Install dependencies
run: make configure
- name: Lint & Type check
run: make lint
- name: Run tests (if any)
if: ${{ hashFiles('tests/**') != '' }}
run: poetry run pytest