...
1name: CI
2on:
3 - push
4 - pull_request
5
6env:
7 GO_VERSION: "oldstable"
8 GOTESTSUM_VERSION: "latest"
9
10jobs:
11 lint:
12 name: Lint
13 runs-on: windows-2019
14 steps:
15 - name: Checkout
16 uses: actions/checkout@v3
17
18 - name: Install go
19 uses: actions/setup-go@v4
20 with:
21 go-version: ${{ env.GO_VERSION }}
22
23 - name: Run golangci-lint
24 uses: golangci/golangci-lint-action@v3
25 with:
26 version: v1.52
27 args: >-
28 --verbose
29 --timeout=5m
30 --config=.golangci.yml
31 --max-issues-per-linter=0
32 --max-same-issues=0
33 --modules-download-mode=readonly
34
35 go-generate:
36 name: Go Generate
37 runs-on: windows-2019
38 steps:
39 - name: Checkout
40 uses: actions/checkout@v3
41
42 - name: Install go
43 uses: actions/setup-go@v4
44 with:
45 go-version: ${{ env.GO_VERSION }}
46
47 - name: Run go generate
48 shell: pwsh
49 run: |
50 Write-Output "::group::go generate"
51 go generate -x ./...
52 Write-Output "::endgroup::"
53 if ($LASTEXITCODE -ne 0) {
54 Write-Output "::error title=Go Generate::Error running go generate."
55 exit $LASTEXITCODE
56 }
57
58 - name: Diff
59 shell: pwsh
60 run: |
61 git add -N .
62 Write-Output "::group::git diff"
63 git diff --stat --exit-code
64 Write-Output "::endgroup::"
65 if ($LASTEXITCODE -ne 0) {
66 Write-Output "::error ::Generated files are not up to date. Please run ``go generate ./...``."
67 exit $LASTEXITCODE
68 }
69
70 test:
71 name: Run Tests
72 needs:
73 - go-generate
74 runs-on: ${{ matrix.os }}
75 strategy:
76 matrix:
77 os: [windows-2019, windows-2022, ubuntu-latest]
78 steps:
79 - name: Checkout
80 uses: actions/checkout@v3
81
82 - name: Install go
83 uses: actions/setup-go@v4
84 with:
85 go-version: ${{ env.GO_VERSION }}
86
87 - name: Install gotestsum
88 run: go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }}
89
90 - name: Test repo
91 run: gotestsum --format standard-verbose --debug -- -gcflags=all=-d=checkptr -v ./...
92
93 build:
94 name: Build Repo
95 needs:
96 - test
97 runs-on: "windows-2019"
98 steps:
99 - name: Checkout
100 uses: actions/checkout@v3
101
102 - name: Install go
103 uses: actions/setup-go@v4
104 with:
105 go-version: ${{ env.GO_VERSION }}
106
107 - run: go build ./pkg/etw/sample/
108 - run: go build ./tools/etw-provider-gen/
109 - run: go build ./tools/mkwinsyscall/
110 - run: go build ./wim/validate/
View as plain text