The race suite ran under Go's default 10 minute limit, which a slow runner would hit; it now has 40 minutes in a 60 minute job. Go is the 1.27 line the code was verified with, not go.mod's minimum, so govulncheck checks a patched standard library, and govulncheck is pinned to v1.9.0 so a new release can't break the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
# Fork CI for the Proton Drive backend. Every step is hermetic: the
|
|
# tests run against the fake server in backend/protondrive/protontest.
|
|
name: ci
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
env:
|
|
# Never pick up a config holding a real Proton remote.
|
|
RCLONE_CONFIG: /notfound
|
|
|
|
jobs:
|
|
protondrive:
|
|
runs-on: ubuntu-latest
|
|
# The race suite takes about 6 minutes on a fast machine and 7 on
|
|
# two cores; the slow runner may take several times that.
|
|
timeout-minutes: 60
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
# The line the code was verified with, not go.mod's minimum,
|
|
# so govulncheck sees a patched standard library.
|
|
go-version: '1.27.x'
|
|
# Caches the module and build caches, keyed on go.sum.
|
|
cache: true
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
- name: Vet
|
|
run: go vet ./backend/protondrive/...
|
|
|
|
- name: Lint
|
|
uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.15.0
|
|
args: ./backend/protondrive/...
|
|
|
|
- name: Test
|
|
# Go's default 10 minute limit per test binary is too short
|
|
# for the race suite on a slow runner.
|
|
run: go test -race -timeout 40m ./backend/protondrive/...
|
|
|
|
- name: Fuzz
|
|
run: |
|
|
for target in $(go test -list '^Fuzz' ./backend/protondrive/ | grep '^Fuzz'); do
|
|
go test -run '^$' -fuzz "^${target}\$" -fuzztime 20s ./backend/protondrive/
|
|
done
|
|
|
|
- name: Vulnerability check
|
|
run: go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 ./backend/protondrive/...
|