ci.yml RawHistoryFolder
1name: CI
2
3on:
4 push:
5 branches: [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: |
69 git config --global --add safe.directory "$GITHUB_WORKSPACE"
70 golangci-lint run --timeout=20m
71
72 test:
73 runs-on: ubuntu-latest
74 container:
75 image: archlinux:latest
76 steps:
77 - name: Install dependencies
78 run: |
79 pacman -Syu --noconfirm
80 pacman -S --noconfirm git go nodejs npm webkitgtk-6.0 gtk4 gobject-introspection base-devel
81 - uses: actions/checkout@v6
82 - name: Cache Go modules
83 uses: actions/cache@v4
84 with:
85 path: ~/go/pkg/mod
86 key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
87 restore-keys: |
88 ${{ runner.os }}-go-mod-
89 - name: Cache Go build cache
90 uses: actions/cache@v4
91 with:
92 path: ~/.cache/go-build
93 key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
94 restore-keys: |
95 ${{ runner.os }}-go-build-
96 - name: Cache npm
97 uses: actions/cache@v4
98 with:
99 path: ~/.npm
100 key: ${{ runner.os }}-npm-${{ hashFiles('webui/package-lock.json') }}
101 restore-keys: |
102 ${{ runner.os }}-npm-
103 - name: Build frontend assets
104 run: make build-frontend
105 - name: Run tests
106 run: go test -v ./...