Skip to content

Commit 47a557a

Browse files
author
Changming Sun
committed
update
1 parent 4bd25cc commit 47a557a

2 files changed

Lines changed: 25 additions & 26 deletions

File tree

.github/workflows/reusable_windows_build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
job-name: # For display purposes in the reusable workflow logs
77
required: true
88
type: string
9+
runner-os: # New input for the runner OS
10+
required: true
11+
type: string
912
cmake-workflow-preset:
1013
required: true
1114
type: string
@@ -25,16 +28,13 @@ on:
2528
permissions:
2629
actions: read
2730
contents: read
28-
# security-events: write is needed only if CodeQL is enabled and uploads SARIF
29-
# We'll set it at the job level within this reusable workflow for clarity.
31+
security-events: write # Needed if CodeQL analysis runs & uploads
3032

3133
jobs:
3234
build_and_optional_analyze:
3335
name: ${{ inputs.job-name }}
34-
runs-on: windows-2022
35-
# Define permissions here based on whether CodeQL might run.
36-
# If enable-codeql can be true, then security-events: write is needed.
37-
permissions:
36+
runs-on: ${{ inputs.runner-os }} # Use the input for runs-on
37+
permissions: # Permissions moved here as they are job-specific
3838
actions: read
3939
contents: read
4040
security-events: write # Needed if CodeQL analysis runs & uploads
@@ -53,15 +53,15 @@ jobs:
5353
- name: Run CMake Workflow
5454
run: |
5555
cmake --workflow --preset ${{ inputs.cmake-workflow-preset }}
56-
shell: cmd # Ensuring shell is explicit for windows runners if needed
56+
shell: cmd
5757

5858
- name: Perform CodeQL Analysis (if enabled)
5959
if: ${{ inputs.enable-codeql }}
6060
uses: github/codeql-action/analyze@v3
6161
with:
62-
category: "/language:cpp" # Category for the analysis
63-
output: ${{ inputs.codeql-sarif-output-dir }} # Directory for SARIF files
64-
upload: failure-only # Upload SARIF results only on failure
62+
category: "/language:cpp"
63+
output: ${{ inputs.codeql-sarif-output-dir }}
64+
upload: failure-only
6565

6666
- name: Filter SARIF (if CodeQL enabled)
6767
if: ${{ inputs.enable-codeql }}
@@ -73,11 +73,11 @@ jobs:
7373
-tests/**/*.*
7474
-build/**/*.*
7575
input: ${{ inputs.codeql-sarif-output-dir }}/cpp.sarif
76-
output: ${{ inputs.codeql-sarif-output-dir }}/cpp.sarif.filtered # Output to a new file
76+
output: ${{ inputs.codeql-sarif-output-dir }}/cpp.sarif.filtered
7777

7878
- name: Upload filtered SARIF (if CodeQL enabled)
7979
if: ${{ inputs.enable-codeql }}
8080
uses: github/codeql-action/upload-sarif@v3
8181
with:
8282
sarif_file: ${{ inputs.codeql-sarif-output-dir }}/cpp.sarif.filtered
83-
category: cpp-${{ inputs.job-name }} # Make category unique if needed
83+
category: cpp-${{ inputs.job-name }}

.github/workflows/win_ci.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
11+
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

1414
jobs:
@@ -17,14 +17,15 @@ jobs:
1717
uses: ./.github/workflows/reusable_windows_build.yml
1818
with:
1919
job-name: Win32_Debug_NoOrt_CodeQL
20+
runner-os: windows-2022
2021
cmake-workflow-preset: windows_win32_debug_no_ort_workflow
2122
enable-codeql: true
22-
# codeql-config-file can be omitted if default is fine
2323

2424
Win32_release_no_ort:
2525
uses: ./.github/workflows/reusable_windows_build.yml
2626
with:
2727
job-name: Win32_Release_NoOrt
28+
runner-os: windows-2022
2829
cmake-workflow-preset: windows_win32_release_no_ort_workflow
2930
enable-codeql: false
3031

@@ -33,41 +34,39 @@ jobs:
3334
uses: ./.github/workflows/reusable_windows_build.yml
3435
with:
3536
job-name: Winx64_Debug_NoOrt_CodeQL
37+
runner-os: windows-2022
3638
cmake-workflow-preset: windows_x64_debug_no_ort_workflow
3739
enable-codeql: true
3840

3941
WinX64_release_no_ort:
4042
uses: ./.github/workflows/reusable_windows_build.yml
4143
with:
4244
job-name: Winx64_Release_NoOrt
45+
runner-os: windows-2022
4346
cmake-workflow-preset: windows_x64_release_no_ort_workflow
4447
enable-codeql: false
45-
48+
4649
WinX64_release:
4750
uses: ./.github/workflows/reusable_windows_build.yml
4851
with:
4952
job-name: Winx64_Release
53+
runner-os: windows-2022
5054
cmake-workflow-preset: windows_x64_release_workflow
5155
enable-codeql: false
5256

53-
# Windows ARM64 Jobs (New)
57+
# Windows ARM64 Jobs
5458
WinARM64_debug_no_ort:
5559
uses: ./.github/workflows/reusable_windows_build.yml
5660
with:
5761
job-name: WinARM64_Debug_NoOrt_CodeQL
58-
cmake-workflow-preset: windows_arm64_debug_no_ort_workflow # Ensure this preset exists
62+
runner-os: windows-11-arm # Use ARM64 runner
63+
cmake-workflow-preset: windows_arm64_debug_no_ort_workflow
5964
enable-codeql: true
6065

61-
WinARM64_release_no_ort:
62-
uses: ./.github/workflows/reusable_windows_build.yml
63-
with:
64-
job-name: WinARM64_Release_NoOrt
65-
cmake-workflow-preset: windows_arm64_release_no_ort_workflow # Ensure this preset exists
66-
enable-codeql: false
67-
6866
WinARM64_release:
6967
uses: ./.github/workflows/reusable_windows_build.yml
7068
with:
7169
job-name: WinARM64_Release
72-
cmake-workflow-preset: windows_arm64_release_workflow # Ensure this preset exists
73-
enable-codeql: false
70+
runner-os: windows-11-arm # Use ARM64 runner
71+
cmake-workflow-preset: windows_arm64_release_workflow
72+
enable-codeql: false

0 commit comments

Comments
 (0)