Repository navigation
107 lines (85 loc) · 2.3 KB
/
Copy pathtest.yml
File metadata and controls
107 lines (85 loc) · 2.3 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
GOTOOLCHAIN: local
jobs:
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: |
go.sum
extra/**/go.sum
examples/**/go.sum
- name: Set up Task
uses: go-task/setup-task@v2
- name: Create temporary Go workspace
run: bash .github/scripts/create-go-workspace.sh --with-examples
- name: Verify workspace resolution
env:
GOWORK: ${{ github.workspace }}/go.work
run: |
set -euo pipefail
test "$(go env GOWORK)" = "${GITHUB_WORKSPACE}/go.work"
go list -m \
-f '{{if .Main}}{{.Path}} => {{.Dir}}{{end}}' \
all |
sed '/^$/d'
- name: Run tests
env:
GOWORK: ${{ github.workspace }}/go.work
run: task test
race:
name: Race
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: |
go.sum
extra/**/go.sum
examples/**/go.sum
- name: Set up Task
uses: go-task/setup-task@v2
- name: Create temporary Go workspace
run: bash .github/scripts/create-go-workspace.sh --with-examples
- name: Verify workspace resolution
env:
GOWORK: ${{ github.workspace }}/go.work
run: |
set -euo pipefail
test "$(go env GOWORK)" = "${GITHUB_WORKSPACE}/go.work"
go list -m \
-f '{{if .Main}}{{.Path}} => {{.Dir}}{{end}}' \
all |
sed '/^$/d'
- name: Run race tests
env:
GOWORK: ${{ github.workspace }}/go.work
run: task test-race