name: CI on: push: branches: [main] paths: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - 'sqlc.yaml' - 'assets/**' - '.github/workflows/**' pull_request: jobs: changes: runs-on: ubuntu-latest outputs: ci: ${{ steps.filter.outputs.ci }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: dorny/paths-filter@v4 id: filter with: filters: | ci: - '**.go' - 'go.mod' - 'go.sum' - '.golangci.yml' - 'Makefile' - 'sqlc.yaml' - 'assets/**' - '.github/workflows/**' lint: needs: changes if: needs.changes.outputs.ci == 'true' runs-on: ubuntu-latest container: image: archlinux:latest steps: - name: Install dependencies run: | pacman -Syu --noconfirm pacman -S --noconfirm git go webkitgtk-6.0 gtk4 gobject-introspection base-devel brotli - 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: Build application and systemviews assets run: make build - name: Install golangci-lint run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin latest - name: Run golangci-lint run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" golangci-lint run --timeout=20m test: needs: changes if: needs.changes.outputs.ci == 'true' runs-on: ubuntu-latest container: image: archlinux:latest steps: - name: Install dependencies run: | pacman -Syu --noconfirm pacman -S --noconfirm git go webkitgtk-6.0 gtk4 libadwaita gobject-introspection base-devel brotli - 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: Build application and systemviews assets run: make build - 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