-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathworkflow-template.yml
More file actions
63 lines (55 loc) · 1.92 KB
/
workflow-template.yml
File metadata and controls
63 lines (55 loc) · 1.92 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
# Query Unit Tests for {LANGUAGE}
#
# This workflow template is for languages that require special OS runners
# (e.g., macOS for Swift, Windows for specific .NET languages).
#
# For languages that can run on Ubuntu, add them to the matrix in:
# .github/workflows/query-unit-tests.yml
#
# Usage:
# 1. Copy this file to: .github/workflows/query-unit-tests-{language}.yml
# 2. Replace all {LANGUAGE} placeholders with the actual language name
# 3. Replace {RUNNER_OS} with the required runner (e.g., macos-latest, windows-latest)
# 4. Update the file extension in the workflow if needed
#
name: Query Unit Tests ({LANGUAGE})
on:
push:
branches:
- main
paths:
- 'server/ql/{LANGUAGE}/**'
pull_request:
branches:
- main
paths:
- 'server/ql/{LANGUAGE}/**'
- 'server/scripts/extract-test-databases.sh'
- 'server/scripts/install-packs.sh'
- 'server/scripts/run-query-unit-tests.sh'
# Prevent duplicate runs from push + PR on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
query-unit-tests:
name: '{LANGUAGE} Query Unit Tests'
# Change this to the required runner for the language
# Options: macos-latest, windows-latest, ubuntu-latest
runs-on: { RUNNER_OS }
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up CodeQL CLI
uses: github/codeql-action/init@480db559a14342288b67e54bd959dd52dc3ee68f # v3
with:
languages: '{LANGUAGE}'
- name: Install CodeQL packs
run: |
./server/scripts/install-packs.sh --language {LANGUAGE}
- name: Extract test databases
run: |
./server/scripts/extract-test-databases.sh --language {LANGUAGE}
- name: Run query unit tests
run: |
./server/scripts/run-query-unit-tests.sh --language {LANGUAGE}