ci.yml RawHistoryFolder
1name: CI
2
3on:
4 push:
5 branches: [dev, main]
6 paths:
7 - '**.go'
8 - 'go.mod'
9 - 'go.sum'
10 - '.golangci.yml'
11 - 'Makefile'
12 - 'sqlc.yaml'
13 - 'assets/**'
14 - '!**.md'
15 - '!docs/**'
16 - '!LICENSE'
17 pull_request:
18 paths:
19 - '**.go'
20 - 'go.mod'
21 - 'go.sum'
22 - '.golangci.yml'
23 - 'Makefile'
24 - 'sqlc.yaml'
25 - 'assets/**'
26 - '!**.md'
27 - '!docs/**'
28 - '!LICENSE'
29
30jobs:
31 lint:
32 runs-on: ubuntu-latest
33 container:
34 image: archlinux:latest
35 steps:
36 - name: Install dependencies
37 run: |
38 pacman -Syu --noconfirm
39 pacman -S --noconfirm git go nodejs npm webkitgtk-6.0 gtk4 gobject-introspection base-devel
40 - uses: actions/checkout@v6
41 - name: Cache Go modules
42 uses: actions/cache@v4
43 with:
44 path: ~/go/pkg/mod
45 key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
46 restore-keys: |
47 ${{ runner.os }}-go-mod-
48 - name: Cache Go build cache
49 uses: actions/cache@v4
50 with:
51 path: ~/.cache/go-build
52 key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
53 restore-keys: |
54 ${{ runner.os }}-go-build-
55 - name: Cache npm
56 uses: actions/cache@v4
57 with:
58 path: ~/.npm
59 key: ${{ runner.os }}-npm-${{ hashFiles('webui/package-lock.json') }}
60 restore-keys: |
61 ${{ runner.os }}-npm-
62 - name: Build frontend assets
63 run: make build-frontend
64 - name: Install golangci-lint
65 run: |
66 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.6.2
67 - name: Run golangci-lint
68 run: golangci-lint run --timeout=20m
69
70 test:
71 runs-on: ubuntu-latest
72 container:
73 image: archlinux:latest
74 steps:
75 - name: Install dependencies
76 run: |
77 pacman -Syu --noconfirm
78 pacman -S --noconfirm git go nodejs npm webkitgtk-6.0 gtk4 gobject-introspection base-devel
79 - uses: actions/checkout@v6
80 - name: Cache Go modules
81 uses: actions/cache@v4
82 with:
83 path: ~/go/pkg/mod
84 key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
85 restore-keys: |
86 ${{ runner.os }}-go-mod-
87 - name: Cache Go build cache
88 uses: actions/cache@v4
89 with:
90 path: ~/.cache/go-build
91 key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
92 restore-keys: |
93 ${{ runner.os }}-go-build-
94 - name: Cache npm
95 uses: actions/cache@v4
96 with:
97 path: ~/.npm
98 key: ${{ runner.os }}-npm-${{ hashFiles('webui/package-lock.json') }}
99 restore-keys: |
100 ${{ runner.os }}-npm-
101 - name: Build frontend assets
102 run: make build-frontend
103 - name: Run tests
104 run: go test -v ./...