-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (65 loc) · 2.46 KB
/
Copy pathci.yml
File metadata and controls
80 lines (65 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# cactus uses Go's built-in crypto/mldsa and declares `go 1.27` in
# go.mod, so it must be built with a Go 1.27 toolchain. 1.27 has not had
# a final release yet, so CI pins the newest release candidate; bump
# GO_VERSION as later RCs appear and set it to '1.27' once 1.27.0 ships.
# GOTOOLCHAIN=local keeps the go command from downloading a different
# toolchain behind our backs -- the RC satisfies the go.mod requirement
# on its own.
env:
GO_VERSION: '1.27.0-rc.2'
GOTOOLCHAIN: local
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# setup-go caches the module and build caches itself, keyed on
# go.sum, so no separate actions/cache step is needed.
- name: Install Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Toolchain version
run: go version
# The Makefile defaults to gotip for local development; CI has a
# real 1.27 toolchain on PATH as `go`.
- name: Vet
run: make GO=go vet
- name: Build
run: make GO=go build
- name: Test (race)
run: go test -race -count=1 ./...
- name: Integration tests (race)
run: make GO=go integration
# The stress test is build-tagged, so the steps above never compile
# it. Vet it here so a break is caught on the pull request rather
# than by the nightly Stress workflow. Running it is that
# workflow's job.
- name: Vet stress-tagged tests
run: go vet -tags=stress ./integration/...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
# golangci-lint release binaries are built with the latest released
# Go and cannot type-check a `go 1.27` module, so build it from
# source with the toolchain installed above instead of using
# golangci/golangci-lint-action. setup-go's cache keeps this fast
# after the first run. Keep the pinned version in sync with the
# Makefile comment. Formatting (gofmt + goimports) is checked here
# too, via the formatters enabled in .golangci.yml.
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
- name: Lint
run: make GO=go lint