Skip to content

Commit 84d21f3

Browse files
committed
Add C++20 windows test but only run it on main ci, not on pr ci
1 parent 1a65061 commit 84d21f3

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

.github/workflows/cpp_matrix_full.json

+17-6
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,36 @@
55
"runs_on": "ubuntu-latest-16-cores",
66
"cache_key": "build-linux",
77
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=17 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp",
8-
"additional_commands": "pixi run -e cpp cpp-docs"
8+
"additional_commands": "pixi run -e cpp cpp-docs",
9+
"pr_ci": true
910
},
1011
{
11-
"name": "Linux x64, C++20",
12+
"name": "Linux x64, C++20 (skipped on PRs)",
1213
"runs_on": "ubuntu-latest-16-cores",
1314
"cache_key": "build-linux",
14-
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=20 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp"
15+
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=20 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp",
16+
"pr_ci": false
1517
},
1618
{
17-
"name": "Windows x64",
19+
"name": "Windows x64, C++17",
1820
"runs_on": "windows-latest-8-cores",
1921
"cache_key": "build-windows",
20-
"extra_env_vars": ""
22+
"extra_env_vars": "RERUN_SET_CXX_VERSION=17",
23+
"pr_ci": true
24+
},
25+
{
26+
"name": "Windows x64, C++20 (skipped on PRs)",
27+
"runs_on": "windows-latest-8-cores",
28+
"cache_key": "build-windows",
29+
"extra_env_vars": "RERUN_SET_CXX_VERSION=20",
30+
"pr_ci": false
2131
},
2232
{
2333
"name": "Mac aarch64",
2434
"runs_on": "macos-15-large",
2535
"cache_key": "build-macos-arm64",
26-
"extra_env_vars": "RERUN_USE_ASAN=1 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp"
36+
"extra_env_vars": "RERUN_USE_ASAN=1 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp",
37+
"pr_ci": true
2738
}
2839
]
2940
}

.github/workflows/reusable_checks_cpp.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,23 @@ jobs:
6262
matrix: ${{ fromJson(needs.matrix_prep.outputs.MATRIX) }}
6363
runs-on: ${{ matrix.runs_on }}
6464
steps:
65+
# Skipping the entire step would apparently require a separate job, not doing that here.
66+
# Instead we keep checking for the `matrix.pr_ci` flag.
67+
# See https://stackoverflow.com/questions/77186893/how-can-i-skip-the-whole-job-for-a-matrix-match-in-github-action
6568
- uses: actions/checkout@v4
69+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
6670
with:
6771
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
6872

6973
- uses: prefix-dev/[email protected]
74+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
7075
with:
7176
pixi-version: v0.41.4
7277
environments: cpp
7378

7479
- name: Set up Rust
7580
uses: ./.github/actions/setup-rust
81+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
7682
with:
7783
cache_key: ${{ matrix.cache_key }}
7884
# Cache will be produced by `reusable_checks/rs-lints`
@@ -82,26 +88,30 @@ jobs:
8288

8389
# Workaround for ASAN issues on Github images https://github.com/actions/runner-images/issues/9491
8490
- name: Fix kernel mmap rnd bits
85-
if: runner.os == 'Linux'
91+
if: (${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}) && runner.os == 'Linux'
8692
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
8793
# high-entropy ASLR in much newer kernels that GitHub runners are
8894
# using leading to random crashes: https://reviews.llvm.org/D148280
8995
run: sudo sysctl vm.mmap_rnd_bits=28
9096

9197
- name: pixi run -e cpp cpp-clean
98+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
9299
run: pixi run -e cpp cpp-clean
93100

94101
- name: pixi run -e cpp cpp-build-all
102+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
95103
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-build-all
96104

97105
- name: pixi run -e cpp cpp-test
106+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
98107
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-test
99108

100109
- name: pixi run -e cpp cpp-build-all-shared-libs
101110
if: ${{ inputs.CHANNEL == 'nightly' }}
102111
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-build-all-shared-libs
103112

104113
- name: additional_commands
114+
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
105115
run: ${{ matrix.additional_commands }}
106116

107117
cpp-formatting:

0 commit comments

Comments
 (0)