Repository navigation
149 lines (125 loc) · 4.27 KB
/
Copy pathci.yml
File metadata and controls
149 lines (125 loc) · 4.27 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: ci
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
# A new push to a PR supersedes the run in flight; runs on main always finish.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
# Actions are pinned to a commit SHA (the tag in the comment); Dependabot
# keeps them current (.github/dependabot.yml).
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true
- name: gofmt
run: make fmt-check
- name: go.mod / go.sum in sync
run: make tidy-check
- name: generated code up to date
run: make gen-check
- name: go vet (linux, darwin, windows)
run: make cross-vet
- name: staticcheck
run: make lint
- name: actionlint (workflows)
run: make actionlint
- name: test (race)
run: make test-race
- name: build
run: make build
# The release ships darwin and windows binaries, and the sandbox, symlink,
# permission and bash code is OS-sensitive, so the tests run there too — as
# a gate: a failure there turns the run red like one on Linux.
test-os:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true
- name: test
run: go test ./...
# The Windows installer end to end, against the latest release: download,
# checksum, install, `ouija version` — in PowerShell 7 and in the 5.1 that
# Windows ships. Its own job, and not a required check: it needs the network
# and a published release, which a PR does not control.
installer:
name: install.ps1 (windows)
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: PowerShell 7
shell: pwsh
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
./scripts/install.ps1 -InstallDir "$env:RUNNER_TEMP\ouija7" -NoPath -RequireProvenance
& "$env:RUNNER_TEMP\ouija7\ouija.exe" version
- name: Windows PowerShell 5.1
shell: powershell
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
./scripts/install.ps1 -InstallDir "$env:RUNNER_TEMP\ouija5" -NoPath -RequireProvenance
& "$env:RUNNER_TEMP\ouija5\ouija.exe" version
# The same for install.sh, on Linux and macOS (Apple silicon), in the
# POSIX sh it is written for.
installer-unix:
name: install.sh (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install.sh
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
sh scripts/install.sh --require-provenance --dir "$RUNNER_TEMP/ouija"
"$RUNNER_TEMP/ouija/ouija" version
test -x "$RUNNER_TEMP/ouija/ouija-mcp"
# Separate job: a vulnerability published today should be visible on its own,
# not hidden inside the lint/test gate.
vuln:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true
- name: govulncheck
run: make vuln