This repository was archived by the owner on Apr 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (82 loc) · 2.37 KB
/
Copy pathtest.yml
File metadata and controls
102 lines (82 loc) · 2.37 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
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
name: Lint & Test
env:
# Keep this in sync with api/Dockerfile
PYTHON_VERSION: "3.10"
# Keep this in sync with ui/Dockerfile and ui/.nvmrc
NODE_VERSION: "16"
on:
push:
branches:
- master
pull_request:
jobs:
# These run natively cause it's faster
ui-test:
name: "UI/Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: ui/package-lock.json
- name: Install dependencies
working-directory: ui/
run: npm install
- name: Type check
working-directory: ui/
run: npm run type-check
- name: Lint
working-directory: ui/
run: npm run lint
- name: Test
working-directory: ui/
run: npm run test
api-lint:
name: "API/Lint"
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: beta_spray.settings.settings_dev
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Install dependencies
working-directory: api/
run: poetry install
- name: Type check
working-directory: api/
run: poetry run mypy
- name: Check formatting
working-directory: api/
run: poetry run black --check .
- name: Lint
working-directory: api/
run: poetry run ruff .
- name: Check for GraphQL schema changes
working-directory: api/
run: |-
poetry run ./src/manage.py export_schema core.schema:schema --path schema.graphql
git diff --exit-code
- name: Check for DB schema changes
working-directory: api/
env:
BETA_SPRAY_DB_BACKEND: django.db.backends.dummy
run: poetry run ./src/manage.py makemigrations --skip-checks --check
# This runs in a docker container because it needs DB access
api-test:
name: "API/Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker Image
run: docker-compose build api
- name: Run Tests
run: docker-compose run api pytest