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