-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (54 loc) · 1.83 KB
/
Copy pathci.yml
File metadata and controls
66 lines (54 loc) · 1.83 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
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@v6
# 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@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Toolchain version
run: go version
- name: Check gofmt
run: |
fmtout=$(gofmt -l .)
if [ -n "$fmtout" ]; then
echo "These files are not gofmt-clean:"
echo "$fmtout"
exit 1
fi
# 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/...