name: CI # Docs-only changes run only the Docs workflow's checks. Later patterns win: # the CLI reference is generated, and a test checks it is current. on: push: branches: [main] paths: - "**" - "!docs/**" - "!**.md" - "docs/content/docs/cli/**" pull_request: paths: - "**" - "!docs/**" - "!**.md" - "docs/content/docs/cli/**" permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: check: # The tests run on macOS in UTC and on Linux in a zone with DST, so a # test that depends on the zone fails here, not only on a laptop. Lint # runs on both, because golangci-lint checks only the files built for # the runner's OS, such as internal/platform's *_darwin.go or *_linux.go. strategy: fail-fast: false matrix: include: - { os: ubuntu-latest, tz: America/Los_Angeles } - { os: macos-latest, tz: UTC } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: version: 2026.11.14 # npm's downloads for the docs' diagrams (lint:docs runs docs:diagrams), keyed on the lock. npm ci # checks each package against the lock's integrity, and the Docs workflow, which publishes, keeps # no cache. - name: Cache npm downloads uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.npm key: npm-${{ runner.os }}-${{ hashFiles('docs/package-lock.json') }} - run: mise run lint - run: mise run test env: TZ: ${{ matrix.tz }} # Its own job, so a newly published vulnerability fails this check alone, # and lint and test still report. The Vulnerabilities workflow scans main # and the releases' binaries each week. vuln: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # Only Go and govulncheck, cached apart from the check jobs' full set. - uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: version: 2026.11.14 install_args: go go:golang.org/x/vuln/cmd/govulncheck cache_key_prefix: mise-v1-vuln # mise run would install the rest of mise.toml's tools first. - run: mise run vuln env: MISE_TASK_RUN_AUTO_INSTALL: "false" # A release builds to the same bytes twice: scripts/repro-check.sh builds # the commit with scripts/release.sh in the release's pinned container, # once under the runner's podman, as root, and once under its Docker, as # the runner's user, from a repository with a stray tag, then compares # every file and checks that every archive's files are root's. It needs # no mise: the container gets Go and GoReleaser from mise.lock. The # containers' process and memory limits need cgroups v2, with the pids # and memory controllers delegated to the runner's user for podman. repro: runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - run: scripts/repro-check.sh # Without cgo, as devvm ships. On Linux the proxy's child confines every # thread of itself through syscall.AllThreadsSyscall, which a build with # cgo, such as the race detector's in the check jobs, refuses: here a # child of the confinement's own tests confines itself on the runner's # kernel, Landlock and the seccomp filter, and is refused what it must # be. (The CLI tests' devvm is built without cgo in the check jobs too.) nocgo: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # Only Go, cached apart from the check jobs' full set. - uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: version: 2026.11.14 install_args: go cache_key_prefix: mise-v1-nocgo - run: go test -count=1 ./internal/landlock/... ./internal/proxy/... env: CGO_ENABLED: "0" # Advisory: nilaway's findings include false positives, so they never fail # CI. A finding testdata/nilaway-baseline.txt hasn't triaged is a warning # on the run, and the run's summary lists the new ones, then every # finding. The job fails only when the check itself breaks (nilaway # can't run, its output can't be read, a stale baseline line), and that # blocks nothing either. nilaway: runs-on: ubuntu-latest continue-on-error: true steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # Only Go and nilaway, cached apart from the other jobs' tools. - uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0 with: version: 2026.11.14 install_args: go go:go.uber.org/nilaway/cmd/nilaway cache_key_prefix: mise-v1-nilaway # scripts/nilaway.sh exits 3 on a finding the baseline hasn't, and # otherwise non-zero when nilaway couldn't run, its output couldn't be # read or a baseline line is stale: the job fails then, after the # summary. - name: Run nilaway env: MISE_TASK_RUN_AUTO_INSTALL: "false" run: | set -uo pipefail out=$RUNNER_TEMP/nilaway.txt mise run nilaway 2>&1 | tee "$out" status=${PIPESTATUS[0]} n=$(grep -c '^new: ' "$out" || true) { echo "## nilaway: $n new findings" echo echo "A new finding needs triage: see [Nil checks](https://next.devvm.dev/docs/contributing/#nil-checks)." echo # Four backticks: nilaway's own backticks can't end the block. echo '````' grep -E '^(new|stale): |^nilaway: ' "$out" || echo "none" echo '````' echo echo "Every finding, the triaged ones included:" echo echo '````' cat "$out" echo '````' } >> "$GITHUB_STEP_SUMMARY" if (( n > 0 )); then echo "::warning title=nilaway::$n new possible nil dereferences: see the run's summary" fi if (( status != 0 && status != 3 )); then echo "nilaway's check failed with status $status: see the run's summary" >&2 exit "$status" fi