-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (129 loc) · 3.74 KB
/
ci.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on: push
env:
COLUMNS: 120
DJANGO_SETTINGS_MODULE: nest.settings
jobs:
ruff-format:
name: ruff format
uses: danielkjellid/github-actions/.github/workflows/python.yaml@main
with:
cmd: make lint-ruff-format
ruff-lint:
name: ruff lint
uses: danielkjellid/github-actions/.github/workflows/python.yaml@main
with:
cmd: make lint-ruff
mypy:
name: ruff lint
uses: danielkjellid/github-actions/.github/workflows/python.yaml@main
with:
cmd: make lint-mypy
eslint:
uses: danielkjellid/github-actions/.github/workflows/node.yaml@main
with:
cmd: make lint-eslint
prettier:
uses: danielkjellid/github-actions/.github/workflows/node.yaml@main
with:
cmd: make lint-prettier
tsc:
uses: danielkjellid/github-actions/.github/workflows/node.yaml@main
with:
cmd: make lint-tsc
lockfile-consistency:
name: lockfile consistency
uses: danielkjellid/github-actions/.github/workflows/python.yaml@main
with:
cmd: poetry lock --check
unused-dependencies:
name: unused dependencies
uses: danielkjellid/github-actions/.github/workflows/python.yaml@main
with:
cmd: poetry run deptry .
python-tests:
name: python tests
runs-on: ubuntu-20.04
services:
minio:
image: bitnami/minio:latest
env:
# Make sure these variables is the same as the defaults in settings.py
MINIO_ROOT_USER: nest # AWS_ACCESS_KEY_ID
MINIO_ROOT_PASSWORD: nesttestpassword # AWS_SECRET_ACCESS_KEY
MINIO_DEFAULT_BUCKETS: dev:download # AWS_S3_BUCKET_NAME
CONSOLE_SECURE_TLS_REDIRECT: off
ports:
- '9000:9000'
- '9001:9001'
volumes:
- 'minio_data:/data'
postgres:
image: postgres:14
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_DB: nest
POSTGRES_USER: nest
POSTGRES_PASSWORD: nest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup project
uses: ./.github/actions/setup-python
- name: Run tests
run: poetry run pytest
env:
DATABASE_URL: postgresql://nest:nest@localhost:${{ job.services.postgres.ports[5432] }}/nest
# PostgreSQL's configuration, used by psql
PGHOST: localhost
PGUSER: nest
PGPASSWORD: nest
PGDATABASE: nest
PGPORT: ${{ job.services.postgres.ports[5432] }}
python-tests2: #
uses: danielkjellid/github-actions/.github/workflows/python.yaml@python-tests
with:
cmd: poetry run deptry .
frontend-tests:
name: frontend tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup project
uses: ./.github/actions/setup-node
- name: Run tests
run: npm test
python-missing-init:
name: missing __init__.py files
permissions: write-all
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: check for missing __init__.py files
uses: ljodal/python-actions/check-for-missing-init@feature/check-for-missing-init
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
paths: nest
ci-done:
# Gather job which deploy workflow can wait on.
name: CI done
needs:
- ruff-format
- ruff-lint
- mypy
- eslint
- prettier
- tsc
- lockfile-consistency
- unused-dependencies
- python-tests
- frontend-tests
- python-missing-init
runs-on: ubuntu-20.04
steps:
- run: echo "CI done!"