-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (73 loc) · 1.75 KB
/
go-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
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
---
name: Go test
on:
push:
paths-ignore:
- ".github/**"
- ".vscode/**"
- "lib/**"
branches:
- main
pull_request_target:
branches:
- main
workflow_dispatch:
merge_group:
types: [checks_requested]
permissions:
contents: read
id-token: write
jobs:
test:
environment: test
if: |
(
github.event.pull_request.head.repo.full_name == 'Azure/alzlib'
)
||
(
github.event.pull_request.head.repo.full_name != 'Azure/alzlib'
&&
contains(github.event.pull_request.labels.*.name, 'PR: Safe to test :test_tube:')
)
||
(
github.event_name == 'workflow_dispatch'
)
||
(
github.event_name == 'merge_group'
)
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: checkout
- uses: actions/setup-go@v4
name: setup go
with:
go-version-file: 'go.mod'
cache: true
- uses: azure/login@v1
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
allow-no-subscriptions: true
- run: make test
name: make test
# Tests are run on Linux using make testcover
if: matrix.os != 'ubuntu-latest'
- run: make testrace
name: make testrace
if: matrix.os == 'ubuntu-latest'
- run: make testcover
name: make testcover
if: matrix.os == 'ubuntu-latest'
- uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest' && github.event_name != 'merge_group'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out