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