Skip to content

Commit 78cdb86

Browse files
committed
add updated Github actions workflows
Signed-off-by: Jay Pipes <jaypipes@gmail.com>
1 parent 628937b commit 78cdb86

4 files changed

Lines changed: 139 additions & 34 deletions

File tree

.github/workflows/fmtcheck.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: fmtcheck
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
fmtcheck:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: harden runner
17+
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
18+
with:
19+
egress-policy: block
20+
disable-sudo: true
21+
allowed-endpoints: >
22+
github.com:443
23+
api.github.com:443
24+
proxy.github.com:443
25+
proxy.golang.org:443
26+
raw.githubusercontent.com:443
27+
objects.githubusercontent.com:443
28+
proxy.golang.org:443
29+
- name: checkout code
30+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31+
- name: setup go
32+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
33+
with:
34+
go-version: 1.21
35+
- name: check fmt
36+
run: 'bash -c "diff -u <(echo -n) <(gofmt -d .)"'

.github/workflows/gate-tests.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read # needed for only-new-issues option below
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: harden runner
18+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
19+
with:
20+
egress-policy: audit
21+
disable-sudo: true
22+
- name: checkout code
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- name: setup go
25+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
26+
with:
27+
go-version: 1.24
28+
- name: lint
29+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
30+
with:
31+
version: v2.2.0
32+
args: --timeout=5m0s --verbose
33+
only-new-issues: true

.github/workflows/test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: gate tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test-mac-windows:
14+
strategy:
15+
matrix:
16+
go: ['1.23']
17+
os: [macos-latest, windows-latest]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: harden runner
21+
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
22+
with:
23+
egress-policy: block
24+
disable-sudo: true
25+
allowed-endpoints: >
26+
github.com:443
27+
api.github.com:443
28+
proxy.github.com:443
29+
raw.githubusercontent.com:443
30+
objects.githubusercontent.com:443
31+
proxy.golang.org:443
32+
blob.core.windows.net:443
33+
- name: checkout code
34+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
35+
- name: setup go
36+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
37+
with:
38+
go-version: ${{ matrix.go }}
39+
check-latest: true
40+
- name: run tests
41+
run: make test
42+
test-linux:
43+
strategy:
44+
matrix:
45+
go: ['1.21', '1.22', '1.23']
46+
os: [ubuntu-latest]
47+
runs-on: ${{ matrix.os }}
48+
steps:
49+
- name: harden runner
50+
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
51+
with:
52+
egress-policy: block
53+
disable-sudo: true
54+
allowed-endpoints: >
55+
github.com:443
56+
api.github.com:443
57+
proxy.github.com:443
58+
raw.githubusercontent.com:443
59+
objects.githubusercontent.com:443
60+
proxy.golang.org:443
61+
blob.core.windows.net:443
62+
- name: checkout code
63+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
64+
- name: setup go
65+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
66+
with:
67+
go-version: ${{ matrix.go }}
68+
check-latest: true
69+
- name: run tests
70+
run: make test

0 commit comments

Comments
 (0)