1
1
name : " Go: Run Tests"
2
2
on :
3
+ push :
4
+ paths :
5
+ - " go/**"
6
+ - .github/workflows/go-tests.yml
7
+ - .github/actions/fetch-codeql/action.yml
8
+ - .github/actions/cache-query-compilation/action.yml
9
+ - codeql-workspace.yml
10
+ branches :
11
+ - main
12
+ - " rc/*"
3
13
pull_request :
4
14
paths :
5
15
- " go/**"
6
16
- .github/workflows/go-tests.yml
7
17
- .github/actions/fetch-codeql/action.yml
18
+ - .github/actions/cache-query-compilation/action.yml
8
19
- codeql-workspace.yml
9
20
jobs :
10
21
test-linux :
@@ -48,14 +59,21 @@ jobs:
48
59
name : qhelp-markdown
49
60
path : go/qhelp-out/**/*.md
50
61
62
+ - name : Cache compilation cache
63
+ id : query-cache
64
+ uses : ./.github/actions/cache-query-compilation
65
+ with :
66
+ key : go-qltest
67
+
51
68
- name : Test
52
69
run : |
53
70
cd go
54
- make test
71
+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
55
72
56
73
test-mac :
57
74
name : Test MacOS
58
75
runs-on : macos-latest-xl
76
+ if : ${{ github.event_name == 'pull_request' }}
59
77
steps :
60
78
- name : Set up Go 1.19
61
79
uses : actions/setup-go@v3
@@ -78,14 +96,20 @@ jobs:
78
96
cd go
79
97
make
80
98
99
+ - name : Cache compilation cache
100
+ id : query-cache
101
+ uses : ./.github/actions/cache-query-compilation
102
+ with :
103
+ key : go-qltest
81
104
- name : Test
82
105
run : |
83
106
cd go
84
- make test
107
+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
85
108
86
109
test-win :
87
110
name : Test Windows
88
111
runs-on : windows-latest-xl
112
+ if : ${{ github.event_name == 'pull_request' }}
89
113
steps :
90
114
- name : Set up Go 1.19
91
115
uses : actions/setup-go@v3
@@ -108,7 +132,13 @@ jobs:
108
132
cd go
109
133
make
110
134
135
+ - name : Cache compilation cache
136
+ id : query-cache
137
+ uses : ./.github/actions/cache-query-compilation
138
+ with :
139
+ key : go-qltest
140
+
111
141
- name : Test
112
142
run : |
113
143
cd go
114
- make test
144
+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
0 commit comments