-
Notifications
You must be signed in to change notification settings - Fork 8
110 lines (91 loc) · 2.4 KB
/
test.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-backend:
env:
UV_CACHE_DIR: /tmp/.uv-cache
strategy:
fail-fast: false
matrix:
python-version:
- "3.12"
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "back/uv.lock"
pyproject-file: "back/pyproject.toml"
- name: Install the project dependencies
run: |
cd back
uv sync --all-extras --dev
- name: Run Linter
run: |
cd back
uv run ruff check src tests
- name: Check Formatting
run: |
cd back
uv run ruff format --check src tests
- name: Check types
run: |
cd back
uv run pyright src
- name: Run tests
run: |
cd back
uv run pytest --cov=src/whombat --cov-report=xml -n auto
- name: "Create cache key for documentation"
if: ${{ matrix.os == 'ubuntu-latest' }}
run: echo "$PWD/back/.venv/bin" >> $GITHUB_PATH
- name: Upload coverage reports to Codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v4
env:
files: back/coverage.xml
fail_ci_if_error: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-frontend:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: |
front/package-lock.json
- name: Install frontend dependencies
run: |
cd front
npm ci
- name: Check formatting
run: |
cd front
npm run format-check
- name: Lint with Nextjs
run: |
cd front
npm run lint
- name: Lint with Typescript Compiler
run: |
cd front
npm run lint-tsc
- name: Run tests
run: |
cd front
npm run test