name: CI on: push: branches: [main] paths: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - 'sqlc.yaml' - 'assets/**' - '.github/workflows/**' - '!**.md' - '!docs/**' - '!LICENSE' pull_request: paths: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - 'sqlc.yaml' - 'assets/**' - '.github/workflows/**' - '!**.md' - '!docs/**' - '!LICENSE' jobs: lint: runs-on: ubuntu-latest container: image: archlinux:latest steps: - name: Install dependencies run: | pacman -Syu --noconfirm pacman -S --noconfirm git go nodejs npm webkitgtk-6.0 gtk4 gobject-introspection base-devel - uses: actions/checkout@v6 - name: Cache Go modules uses: actions/cache@v5 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-mod- - name: Cache Go build cache uses: actions/cache@v5 with: path: ~/.cache/go-build key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-build- - name: Cache npm uses: actions/cache@v5 with: path: ~/.npm key: ${{ runner.os }}-npm-${{ hashFiles('webui/package-lock.json') }} restore-keys: | ${{ runner.os }}-npm- - name: Build frontend assets run: make build-frontend - name: Install golangci-lint run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.9.0 - name: Run golangci-lint run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" golangci-lint run --timeout=20m test: runs-on: ubuntu-latest container: image: archlinux:latest steps: - name: Install dependencies run: | pacman -Syu --noconfirm pacman -S --noconfirm git go nodejs npm webkitgtk-6.0 gtk4 libadwaita gobject-introspection base-devel - uses: actions/checkout@v6 - name: Cache Go modules uses: actions/cache@v5 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-mod- - name: Cache Go build cache uses: actions/cache@v5 with: path: ~/.cache/go-build key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-build- - name: Cache npm uses: actions/cache@v5 with: path: ~/.npm key: ${{ runner.os }}-npm-${{ hashFiles('webui/package-lock.json') }} restore-keys: | ${{ runner.os }}-npm- - name: Build frontend assets run: make build-frontend - name: Run tests env: GDK_BACKEND: wayland WAYLAND_DISPLAY: wayland-0 run: go test -v ./... - name: Verify purego-only constraints run: make verify-purego - name: Verify CGO-disabled build run: CGO_ENABLED=0 go build -buildvcs=false -o /tmp/dumber ./cmd/dumber && rm -f /tmp/dumber