-
Notifications
You must be signed in to change notification settings - Fork 407
112 lines (110 loc) · 2.97 KB
/
ci.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
111
112
name: CI Checks
on:
push:
branches:
- "main"
paths-ignore:
- "**.md"
- LICENSE
- "docker-compose.yml"
- "docker-compose.dev.yml"
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"
- ".github/release-drafter.yml"
pull_request:
branches:
- "*"
paths-ignore:
- "**.md"
- LICENSE
- "docker-compose.yml"
- "docker-compose.dev.yml"
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"
- ".github/release-drafter.yml"
workflow_dispatch:
release:
types: [published, edited]
jobs:
check-json-syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check syntax of models JSON file
run: cat ./api/src/serge/data/models.json | jq -e .
validate-models-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate models.json against a json schema
uses: cardinalby/schema-validator-action@v3
with:
file: './api/src/serge/data/models.json'
schema: './api/src/serge/schema/schema.json'
fileParser: json
mode: default
python-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip' # caching pip dependencies
- name: Install dependencies with poetry
working-directory: ./api
run: |
pip install poetry
poetry install
- name: Run unit tests
working-directory: ./api
run: |
poetry run python -m pytest -v --color=yes
check-sh-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: luizm/[email protected]
env:
SHFMT_OPTS: "-s"
SHELLCHECK_OPTS: "-P scripts/ -e SC1091"
with:
sh_checker_only_diff: false
sh_checker_comment: false
check-api-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip' # caching pip dependencies
- name: Run ruff check
uses: chartboost/ruff-action@v1
with:
src: "./api"
args: "check --verbose"
- name: Run ruff format check
uses: chartboost/ruff-action@v1
with:
src: "./api"
args: "format --check --verbose"
check-web-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Web
working-directory: ./web
run: npm ci
- name: Run linting
working-directory: ./web
run: npm run lint
- name: Check Type Errors
working-directory: ./web
run: npm run check
- name: Build Web
working-directory: ./web
run: npm run build