-
Notifications
You must be signed in to change notification settings - Fork 158
55 lines (48 loc) · 1.28 KB
/
windows-test.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
name: windows-test
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/windows-test.yml'
- 'cmd/**'
- 'internal/**'
- 'pkg/**'
- 'tests/**'
- 'Makefile'
- 'go.mod'
- 'go.sum'
- '!**.md'
- '!packaging/**'
env:
GO_VERSION: '1.22.7'
concurrency:
group: windows-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
windows-test:
name: windows-test
runs-on: ${{ matrix.OS }}
strategy:
matrix:
OS: [ "windows-2022" ]
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Ensure required ports in the dynamic range are available
run: |
$ErrorActionPreference = 'Continue'
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- name: Unit tests with coverage
run: |
$ErrorActionPreference = 'Stop'
$env:GOPATH = "${env:USERPROFILE}\go"
$env:PATH = "$env:PATH;${env:GOPATH}\bin"
go env -w CGO_ENABLED=0
go test -v -cover ./...