-
-
Notifications
You must be signed in to change notification settings - Fork 503
83 lines (73 loc) · 2.68 KB
/
ci-windows.yml
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
name: Windows tests
on:
repository_dispatch:
types: [windows-test-command]
jobs:
docker:
# At the moment, we are running a self-hosted runner on Windows 2022.
runs-on: [self-hosted, Windows, X64]
strategy:
fail-fast: false
steps:
- name: Create pending status
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.repos.createStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.client_payload.pull_request.head.sha,
state: 'pending',
target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
context: 'Windows tests',
})
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.x
id: go
- name: modVerify
run: go mod verify
- name: modTidy
run: go mod tidy
- name: ensure compilation
run: go build
- name: go test
run: |
go install gotest.tools/gotestsum@latest
gotestsum --format short-verbose --rerun-fails=5 --packages="./..." --junitfile TEST-unit.xml
- name: Create success status
uses: actions/[email protected]
if: success()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.repos.createStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.client_payload.pull_request.head.sha,
state: 'success',
target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
context: 'Windows tests',
})
- name: Create failure status
uses: actions/[email protected]
if: failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.repos.createStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.client_payload.pull_request.head.sha,
state: 'failure',
target_url: `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
context: 'Windows tests',
})