-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MacOS C++ CI, add Linux C++20 CI (#4120)
### What * Fixes #4116 New way of doing test matrices: Load different json files to configure an entire job. -> Much nicer config interface (a separate clean file <3) and less & less arcane job setup \o/ Adds tests for Mac AND Linux C++20! Runs full matrix on main and whenever cpp/hpp/cmake changes are registered. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4120) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4120) - [Docs preview](https://rerun.io/preview/0f7f7ebe692424cf6a9e4f269f3b0790c74f9acd/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/0f7f7ebe692424cf6a9e4f269f3b0790c74f9acd/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
- Loading branch information
Showing
9 changed files
with
190 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"include": [ | ||
{ | ||
"name": "Linux x64, C++17", | ||
"runs_on": "ubuntu-latest-16-cores", | ||
"cache_key": "build-linux", | ||
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=17" | ||
}, | ||
{ | ||
"name": "Linux x64, C++20", | ||
"runs_on": "ubuntu-latest-16-cores", | ||
"cache_key": "build-linux", | ||
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=20" | ||
}, | ||
{ | ||
"name": "Windows x64", | ||
"runs_on": "windows-latest-8-cores", | ||
"cache_key": "build-windows", | ||
"extra_env_vars": "" | ||
}, | ||
{ | ||
"name": "Mac aarch64", | ||
"runs_on": "macos-latest-large", | ||
"cache_key": "build-macos-arm", | ||
"extra_env_vars": "RERUN_USE_ASAN=1" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"include": [ | ||
{ | ||
"name": "Linux x64", | ||
"runs_on": "ubuntu-latest-16-cores", | ||
"cache_key": "build-linux", | ||
"extra_env_vars": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,77 +369,3 @@ jobs: | |
clang-format-version: "16" | ||
# Only check c/cpp/h/hpp (default checks also .proto and others) | ||
include-regex: ^.*\.(c|cpp|h|hpp)$ | ||
|
||
cpp-tests-linux: | ||
name: C++ tests Linux | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rerunio/ci_docker:0.10.0 | ||
env: | ||
RUSTC_WRAPPER: "sccache" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }} | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.6.0 | ||
cache: true | ||
|
||
- name: Set up Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
cache_key: "build-linux" | ||
# Cache will be produced by `reusable_checks/rs-lints` | ||
save_cache: false | ||
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
|
||
# TODO(emilk): make this work somehow. Right now this just results in | ||
# > Compiler: GNU 12.3.0 (/__w/rerun/rerun/.pixi/env/bin/x86_64-conda-linux-gnu-c++) | ||
# 😭 | ||
# - name: Build and run C++ tests with clang++ | ||
# shell: bash | ||
# run: | | ||
# pixi run cpp-clean | ||
# RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run cpp-build-all | ||
# RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run cpp-test | ||
|
||
- name: Build and run C++ tests with g++ | ||
shell: bash | ||
run: | | ||
pixi run cpp-clean | ||
RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=g++ pixi run cpp-build-all | ||
RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=g++ pixi run cpp-test | ||
cpp-tests-windows: | ||
name: C++ tests Windows | ||
runs-on: windows-latest-8-cores | ||
env: | ||
RUSTC_WRAPPER: "sccache" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }} | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.6.0 | ||
cache: true | ||
|
||
- name: Set up Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
cache_key: "build-windows" | ||
# Cache will be produced by `reusable_checks/rs-lints` | ||
save_cache: false | ||
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
|
||
- name: Build and run C++ tests with MSVC | ||
shell: bash | ||
run: | | ||
pixi run cpp-clean | ||
RERUN_WERROR=ON pixi run cpp-build-all | ||
RERUN_WERROR=ON pixi run cpp-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: "C++ Tests on all platforms & compilers" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
CONCURRENCY: | ||
required: true | ||
type: string | ||
FULL: | ||
# Booleans are almost unusable | ||
# See https://medium.com/@sohail.ra5/github-actions-passing-boolean-input-variables-to-reusable-workflow-call-42d39bf7342e | ||
type: string | ||
required: true | ||
default: 'true' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
CONCURRENCY: | ||
required: false | ||
type: string | ||
default: "adhoc" | ||
FULL: | ||
description: "If false only linux is tested" | ||
type: choice | ||
options: | ||
- 'true' | ||
- 'false' | ||
|
||
concurrency: | ||
group: ${{ inputs.CONCURRENCY }}-checks_cpp | ||
cancel-in-progress: true | ||
|
||
env: | ||
# See: https://github.com/marketplace/actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "false" | ||
|
||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
|
||
jobs: | ||
matrix_prep: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
MATRIX: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }} | ||
- name: Load C++ test matrix | ||
id: set-matrix | ||
run: | | ||
echo "Full matrix: ${{ inputs.FULL }}" | ||
if ${{ inputs.FULL }}; then | ||
echo "matrix=$(jq -c . < ./.github/workflows/cpp_matrix_full.json)" >> $GITHUB_OUTPUT | ||
else | ||
echo "matrix=$(jq -c . < ./.github/workflows/cpp_matrix_partial.json)" >> $GITHUB_OUTPUT | ||
fi | ||
cpp-tests: | ||
name: C++ build & test - ${{ matrix.name }} | ||
needs: matrix_prep | ||
strategy: | ||
matrix: ${{ fromJson(needs.matrix_prep.outputs.MATRIX) }} | ||
runs-on: ${{ matrix.runs_on }} | ||
env: | ||
RUSTC_WRAPPER: "sccache" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }} | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.6.0 | ||
cache: true | ||
|
||
- name: Set up Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
cache_key: ${{ matrix.cache_key }} | ||
# Cache will be produced by `reusable_checks/rs-lints` | ||
save_cache: false | ||
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
|
||
- name: Build and run C++ tests | ||
shell: bash | ||
run: | | ||
pixi run cpp-clean | ||
${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run cpp-build-all | ||
${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run cpp-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters