11name : " Go: Run Tests"
22on :
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/*"
313 pull_request :
414 paths :
515 - " go/**"
616 - .github/workflows/go-tests.yml
717 - .github/actions/fetch-codeql/action.yml
18+ - .github/actions/cache-query-compilation/action.yml
819 - codeql-workspace.yml
920jobs :
1021 test-linux :
@@ -48,14 +59,21 @@ jobs:
4859 name : qhelp-markdown
4960 path : go/qhelp-out/**/*.md
5061
62+ - name : Cache compilation cache
63+ id : query-cache
64+ uses : ./.github/actions/cache-query-compilation
65+ with :
66+ key : go-qltest
67+
5168 - name : Test
5269 run : |
5370 cd go
54- make test
71+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
5572
5673 test-mac :
5774 name : Test MacOS
5875 runs-on : macos-latest-xl
76+ if : ${{ github.event_name == 'pull_request' }}
5977 steps :
6078 - name : Set up Go 1.19
6179 uses : actions/setup-go@v3
@@ -78,14 +96,20 @@ jobs:
7896 cd go
7997 make
8098
99+ - name : Cache compilation cache
100+ id : query-cache
101+ uses : ./.github/actions/cache-query-compilation
102+ with :
103+ key : go-qltest
81104 - name : Test
82105 run : |
83106 cd go
84- make test
107+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
85108
86109 test-win :
87110 name : Test Windows
88111 runs-on : windows-latest-xl
112+ if : ${{ github.event_name == 'pull_request' }}
89113 steps :
90114 - name : Set up Go 1.19
91115 uses : actions/setup-go@v3
@@ -108,7 +132,13 @@ jobs:
108132 cd go
109133 make
110134
135+ - name : Cache compilation cache
136+ id : query-cache
137+ uses : ./.github/actions/cache-query-compilation
138+ with :
139+ key : go-qltest
140+
111141 - name : Test
112142 run : |
113143 cd go
114- make test
144+ make test cache="${{ steps.query-cache.outputs.cache-dir }}"
0 commit comments