Skip to content

Commit 03beff6

Browse files
authored
Merge pull request #3 from kolyshkin/add-ci
Add CI
2 parents afa9f8f + e614e26 commit 03beff6

File tree

5 files changed

+149
-1
lines changed

5 files changed

+149
-1
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: test
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
- release-*
9+
pull_request:
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
unit:
15+
timeout-minutes: 10
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-24.04]
20+
go-version: [1.23.x, 1.24.x]
21+
race: ["-race", ""]
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-go@v5
27+
with:
28+
go-version: ${{ matrix.go-version }}
29+
- run: go test -timeout 3m ${{ matrix.race }} -v ./...
30+
31+
all-done:
32+
needs:
33+
- unit
34+
runs-on: ubuntu-24.04
35+
steps:
36+
- run: echo "All jobs completed"

.github/workflows/validate.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: validate
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
- release-*
9+
pull_request:
10+
env:
11+
GO_VERSION: 1.24
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
lint:
17+
timeout-minutes: 30
18+
permissions:
19+
contents: read
20+
pull-requests: read
21+
checks: write # to allow the action to annotate code in the PR.
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 2
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version: "${{ env.GO_VERSION }}"
30+
- uses: golangci/golangci-lint-action@v6
31+
with:
32+
version: v1.64
33+
# Extra linters, only checking new code from a pull request.
34+
- name: lint-extra
35+
if: github.event_name == 'pull_request'
36+
run: |
37+
golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1
38+
39+
go-fix:
40+
runs-on: ubuntu-24.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 2
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version: "${{ env.GO_VERSION }}"
48+
- name: run go fix
49+
run: |
50+
go fix ./...
51+
git diff --exit-code
52+
53+
codespell:
54+
runs-on: ubuntu-24.04
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: install deps
58+
# Use a known version of codespell.
59+
run: pip install --break-system-packages codespell==v2.4.1
60+
- name: run codespell
61+
run: codespell
62+
63+
space-at-eol:
64+
runs-on: ubuntu-24.04
65+
steps:
66+
- uses: actions/checkout@v4
67+
- run: if git -P grep -I -n '\s$'; then echo "^^^ extra whitespace at EOL, please fix"; exit 1; fi
68+
69+
deps:
70+
runs-on: ubuntu-24.04
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: actions/setup-go@v5
74+
with:
75+
go-version: "${{ env.GO_VERSION }}"
76+
- run: go mod tidy --diff
77+
78+
all-done:
79+
needs:
80+
- codespell
81+
- deps
82+
- go-fix
83+
- lint
84+
- space-at-eol
85+
runs-on: ubuntu-24.04
86+
steps:
87+
- run: echo "All jobs completed"

.golangci-extra.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is golangci-lint config file which is used to check NEW code in
2+
# github PRs only (see lint-extra in .github/workflows/validate.yml).
3+
#
4+
# For the default linter config, see .golangci.yml. This config should
5+
# only enable additional linters not enabled in the default config.
6+
7+
linters:
8+
disable-all: true
9+
enable:
10+
- godot
11+
- revive
12+

.golangci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# For documentation, see https://golangci-lint.run/usage/configuration/
2+
3+
linters:
4+
enable:
5+
- gofumpt
6+
- errorlint
7+
- unconvert
8+
- unparam
9+
10+
linters-settings:
11+
govet:
12+
enable:
13+
- nilness

RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ However, specification releases have special restrictions in the [OCI charter][c
2323
* They are the target of backwards compatibility (§7.g), and
2424
* They are subject to the OFWa patent grant (§8.d and e).
2525

26-
To avoid unfortunate side effects (onerous backwards compatibity requirements or Member resignations), the following additional procedures apply to specification releases:
26+
To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases:
2727

2828
### Planning a release
2929

0 commit comments

Comments
 (0)