-
-
Notifications
You must be signed in to change notification settings - Fork 107
128 lines (121 loc) · 3.16 KB
/
checks.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Checks
on:
push:
branches:
- main
- develop
pull_request:
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.22"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --timeout=10m
go-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.22"
- name: Run tests
run: go test -v ./...
webui-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: webui
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: npm ci
- run: npm run eslint:check
webui-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: webui
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: npm ci
- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
run: npm test
working-directory: webui
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --check .
# This job runs all code generations and builds the WebUI, to check that everything is correctly committed
generated:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:16-alpine
# Provide the password for postgres
env:
PGUSER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bitmagnet
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check nothing changed
run: git diff --exit-code
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v5
with:
go-version: "^1.22"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install web app, apply database migrations, generate code and build web app
run: |
npm install -g @angular/cli; \
(cd webui && npm ci); \
task migrate; \
task gen; \
task build-webui
env:
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_NAME: bitmagnet
- name: Check nothing changed
run: git diff --exit-code