-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (44 loc) · 1.22 KB
/
pr-build-merge.yaml
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
name: PR build and merge
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install uv and set up its cache
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project dependancies
run: uv sync --all-extras --dev
- name: Create the .env file
run: cp env.example .env
lint:
runs-on: ubuntu-latest
needs: build
steps:
- name: Run linting
run: uv run ruff check .
# TODO: Add formatting checks
- name: Run type checks
run: uv run mypy .
- name: Run security checks
run: uv run bandit -c pyproject.toml -r .
- name: Run tests
run: uv run pytest
# TODO: save coverage report in artefacts
# TODO: Generate the openapi.json spec and save it as artefact
# TODO: Build the production docker container