Skip to content

Commit 7a46924

Browse files
authored
Merge pull request #350 from jaypipes/prep-for-v1
clean CI jobs, Makefile and go.mod/Dockerfile
2 parents e4a5d4f + 98dc049 commit 7a46924

File tree

10 files changed

+244
-505
lines changed

10 files changed

+244
-505
lines changed

.github/workflows/fmtcheck.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
18+
with:
19+
egress-policy: block
20+
disable-sudo: true
21+
allowed-endpoints: >
22+
github.com:443
23+
- name: checkout code
24+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
25+
- name: setup go
26+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
27+
with:
28+
go-version: 1.19
29+
- name: check fmt
30+
run: 'bash -c "diff -u <(echo -n) <(gofmt -d .)"'

.github/workflows/go.yml

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

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
19+
with:
20+
egress-policy: block
21+
disable-sudo: true
22+
allowed-endpoints: >
23+
github.com:443
24+
api.github.com:443
25+
raw.githubusercontent.com:443
26+
objects.hdec.top:443
27+
- name: checkout code
28+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
29+
- name: setup go
30+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
31+
with:
32+
go-version: 1.19
33+
- name: lint
34+
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
35+
with:
36+
version: v1.53
37+
args: --timeout=5m0s --verbose
38+
only-new-issues: true

.github/workflows/test.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
# see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
13+
jobs:
14+
# tier-1
15+
# main development platform, gets features first and it's most tested
16+
ubuntu-latest:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
go: [ '1.19', '1.20']
21+
steps:
22+
- name: harden runner
23+
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
24+
with:
25+
egress-policy: block
26+
disable-sudo: true
27+
allowed-endpoints: >
28+
github.com:443
29+
- name: checkout code
30+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
31+
- name: setup go
32+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
33+
with:
34+
go-version: ${{ matrix.go }}
35+
- name: run tests
36+
env:
37+
GHW_TESTING_SKIP_BLOCK: "1"
38+
GHW_TESTING_SKIP_GPU: "1"
39+
run: go test -v ./...
40+
41+
ubuntu-2004:
42+
runs-on: ubuntu-20.04
43+
strategy:
44+
matrix:
45+
go: [ '1.18', '1.19']
46+
steps:
47+
- name: harden runner
48+
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
49+
with:
50+
egress-policy: block
51+
disable-sudo: true
52+
allowed-endpoints: >
53+
github.com:443
54+
- name: checkout code
55+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
56+
- name: setup go
57+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
58+
with:
59+
go-version: ${{ matrix.go }}
60+
- name: run tests
61+
env:
62+
GHW_TESTING_SKIP_BLOCK: "1"
63+
GHW_TESTING_SKIP_GPU: "1"
64+
run: go test -v ./...
65+
66+
windows-2022:
67+
runs-on: windows-2022
68+
strategy:
69+
matrix:
70+
go: [ '1.19' ]
71+
steps:
72+
- name: harden runner
73+
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
74+
with:
75+
egress-policy: block
76+
disable-sudo: true
77+
allowed-endpoints: >
78+
github.com:443
79+
- name: checkout code
80+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
81+
- name: setup go
82+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
83+
with:
84+
go-version: ${{ matrix.go }}
85+
- name: run tests
86+
env:
87+
GHW_TESTING_SKIP_BLOCK: "1"
88+
GHW_TESTING_SKIP_GPU: "1"
89+
GHW_TESTING_SKIP_CPU: "1"
90+
GHW_TESTING_SKIP_MEMORY: "1"
91+
GHW_TESTING_SKIP_HOST: "1"
92+
GHW_TESTING_SKIP_NET: "1"
93+
GHW_TESTING_SKIP_PCI: "1"
94+
GHW_TESTING_SKIP_TOPOLOGY: "1"
95+
run: go test -v ./...
96+
97+
windows-2019:
98+
runs-on: windows-2019
99+
strategy:
100+
matrix:
101+
go: [ '1.18' ]
102+
steps:
103+
- name: harden runner
104+
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
105+
with:
106+
egress-policy: block
107+
disable-sudo: true
108+
allowed-endpoints: >
109+
github.com:443
110+
- name: checkout code
111+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
112+
- name: setup go
113+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
114+
with:
115+
go-version: ${{ matrix.go }}
116+
- name: run tests
117+
env:
118+
GHW_TESTING_SKIP_BLOCK: "1"
119+
GHW_TESTING_SKIP_GPU: "1"
120+
GHW_TESTING_SKIP_CPU: "1"
121+
GHW_TESTING_SKIP_MEMORY: "1"
122+
GHW_TESTING_SKIP_HOST: "1"
123+
GHW_TESTING_SKIP_NET: "1"
124+
GHW_TESTING_SKIP_PCI: "1"
125+
GHW_TESTING_SKIP_TOPOLOGY: "1"
126+
run: go test -v ./...
127+
128+
# tier-2
129+
# best-effort support, limited to most recent platforms (OS+go)
130+
131+
# NOTE(jaypipes): We currently only support block information on MacOS, and
132+
# the tests have block skipped because we cannot get meaningful information
133+
# about the block devices in the Github Actions Runner virtual machines. So
134+
# this is really just a test of whether the library builds on MacOS 12.
135+
macos-12:
136+
runs-on: macos-12
137+
strategy:
138+
matrix:
139+
go: [ '1.18' ]
140+
steps:
141+
- name: harden runner
142+
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
143+
with:
144+
egress-policy: block
145+
disable-sudo: true
146+
allowed-endpoints: >
147+
github.com:443
148+
- name: checkout code
149+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
150+
- name: setup go
151+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
152+
with:
153+
go-version: ${{ matrix.go }}
154+
- name: run tests
155+
env:
156+
GHW_TESTING_SKIP_BLOCK: "1"
157+
GHW_TESTING_SKIP_CPU: "1"
158+
GHW_TESTING_SKIP_GPU: "1"
159+
GHW_TESTING_SKIP_HOST: "1"
160+
GHW_TESTING_SKIP_MEMORY: "1"
161+
GHW_TESTING_SKIP_NET: "1"
162+
GHW_TESTING_SKIP_PCI: "1"
163+
GHW_TESTING_SKIP_TOPOLOGY: "1"
164+
run: go test -v ./...

0 commit comments

Comments
 (0)