-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (75 loc) · 2.03 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: stable
- uses: actions/setup-node@v4
with:
node-version: 17
- run: make
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 17
- run: cd src/handler/webui && npm ci
- run: cd src/handler/webui && npm run test
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: stable
- run: mkdir -p src/handler/webui/build/release
- run: touch src/handler/webui/build/release/NOFILES
- run: sudo apt update
- run: sudo apt install mpd mpc
- run: sudo cp -r ./testdata $(sudo sed -n 's/^music_directory\s\+"\(.\+\)"/\1/p' /etc/mpd.conf)
- run: |
echo -e '
max_connections "100"
audio_output {
type "null"
name "My Null Output"
mixer_type "software"
}' | sudo tee -a /etc/mpd.conf
- run: sudo service mpd restart
- run: sleep 2
- run: mpc update --wait
- run: go test -race -cover ./src/...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: stable
- run: mkdir -p src/handler/webui/build/release
- run: touch src/handler/webui/build/release/NOFILES
- run: gofmt -s -d ./src/
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip3 install -U Commitizen
# The commit hash here is that of the commit where we started using conventional commits.
- run: cz check --rev-range 03839a86..HEAD