Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MacOS C++ CI, add Linux C++20 CI #4120

Merged
merged 31 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd43f89
separate C++ test workflow that only runs linux on push if no cpp fil…
Wumpf Nov 1, 2023
84d4f3c
try a json file based matrix
Wumpf Nov 1, 2023
fc83abf
fix?
Wumpf Nov 1, 2023
df27d14
...fix?
Wumpf Nov 1, 2023
8751af6
maybe this one?
Wumpf Nov 1, 2023
be0b479
paths are hard and stuff
Wumpf Nov 1, 2023
64f5d9e
fix group
Wumpf Nov 1, 2023
c4b7569
review comments and more fix attempts
Wumpf Nov 1, 2023
f2f66f6
fix old checkout task
Wumpf Nov 1, 2023
f6e0919
ref on checkout helping??
Wumpf Nov 1, 2023
a03cbff
fix loading test matrix..? Maybe..?
Wumpf Nov 1, 2023
f7d859e
I have no idea
Wumpf Nov 1, 2023
79e4acd
some debug output
Wumpf Nov 1, 2023
061dfde
moar
Wumpf Nov 1, 2023
9b03a30
going nuts
Wumpf Nov 1, 2023
3831ece
bool fix, more debug
Wumpf Nov 1, 2023
fd0fae6
fix jsons
Wumpf Nov 1, 2023
31cb7f1
dunno
Wumpf Nov 1, 2023
59d0809
looks like this worked for someone else?
Wumpf Nov 1, 2023
6da2034
more trying around with the FULL env var
Wumpf Nov 1, 2023
aa990f1
fix boolean handling?
Wumpf Nov 1, 2023
3e22eb3
stop using broken booleans
Wumpf Nov 1, 2023
96246d4
fix?
Wumpf Nov 1, 2023
3c6b236
script check fix
Wumpf Nov 1, 2023
22c1714
I don't know bash
Wumpf Nov 1, 2023
e683d2b
cpp change detection re-enabled
Wumpf Nov 1, 2023
0dce646
Make a not entirely pointless cmake change to trigger full C++ matrix
Wumpf Nov 1, 2023
e0cc1d5
make msvc build with RERUN_USE_ASAN set
Wumpf Nov 1, 2023
ae2646b
add C++20 test build
Wumpf Nov 1, 2023
4968668
cmake cleanup
Wumpf Nov 1, 2023
0f7f7eb
spelling
Wumpf Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/cpp_matrix_full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"runs_on": "ubuntu-latest-16-cores",
"cache_key": "build-linux"
},
{
"runs_on": "windows-latest-8-cores",
"cache_key": "build-windows"
},
{
"runs_on": "macos-latest-large",
"cache_key": "build-macos-arm"
}
]
6 changes: 6 additions & 0 deletions .github/workflows/cpp_matrix_minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"runs_on": "ubuntu-latest-16-cores",
"cache_key": "build-linux"
}
]
25 changes: 25 additions & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,31 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit


cpp-paths-filter:
runs-on: ubuntu-latest
outputs:
cpp_changes: ${{ steps.filter.outputs.rerun_cpp }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
rerun_cpp:
- 'rerun_cpp/**'
Wumpf marked this conversation as resolved.
Show resolved Hide resolved

# Run cpp tests for all platforms
cpp-tests:
name: "C++ tests"
# Wait from the cpp-paths-filter to be completed before starting next-job
needs: cpp-paths-filter
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/reusable_checks_cpp.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
MINIMAL: ${{ !needs.cpp-paths-filter.outputs.cpp_changes }}
secrets: inherit

min-test-wheel:
name: "Minimum Wheel"
if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/on_push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
CONCURRENCY: push-${{ github.ref_name }}
secrets: inherit

checks_cpp:
name: Checks
uses: ./.github/workflows/reusable_checks_cpp.yml
with:
CONCURRENCY: push-${{ github.ref_name }}
secrets: inherit

# Check that a CLEAN container with just `cargo` on it can build rerun:
clean-build:
name: cargo build on clean container
Expand Down Expand Up @@ -97,7 +104,7 @@ jobs:
# Build rerun_c library binaries:

build-rerun_c-and-upload-linux:
needs: [checks]
needs: [checks, checks_cpp]
name: "Linux-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
Expand All @@ -106,7 +113,7 @@ jobs:
secrets: inherit

build-rerun_c-and-upload-macos-intel:
needs: [checks]
needs: [checks, checks_cpp]
name: "Mac-Intel: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
Expand All @@ -115,7 +122,7 @@ jobs:
secrets: inherit

build-rerun_c-and-upload-macos-arm:
needs: [checks]
needs: [checks, checks_cpp]
name: "Mac-Arm: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
Expand All @@ -124,7 +131,7 @@ jobs:
secrets: inherit

build-rerun_c-and-upload-windows:
needs: [checks]
needs: [checks, checks_cpp]
name: "Windows-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
Expand All @@ -136,7 +143,7 @@ jobs:
# Build rerun-cli (rerun binaries):

build-rerun-cli-and-upload-linux:
needs: [checks]
needs: [checks, checks_cpp]
name: "Linux-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
Expand All @@ -145,7 +152,7 @@ jobs:
secrets: inherit

build-rerun-cli-and-upload-macos-intel:
needs: [checks]
needs: [checks, checks_cpp]
name: "Mac-Intel: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
Expand All @@ -154,7 +161,7 @@ jobs:
secrets: inherit

build-rerun-cli-and-upload-macos-arm:
needs: [checks]
needs: [checks, checks_cpp]
name: "Mac-Arm: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
Expand All @@ -163,7 +170,7 @@ jobs:
secrets: inherit

build-rerun-cli-and-upload-windows:
needs: [checks]
needs: [checks, checks_cpp]
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
name: "Windows-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
Expand All @@ -174,7 +181,7 @@ jobs:
# -----------------------------------------------------------------------------------

build-linux:
needs: [checks]
needs: [checks, checks_cpp]
name: "Linux: Build/Test Wheels"
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
Expand All @@ -185,7 +192,7 @@ jobs:
secrets: inherit

build-windows:
needs: [checks]
needs: [checks, checks_cpp]
name: "Windows: Build/Test Wheels"
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
Expand All @@ -196,7 +203,7 @@ jobs:
secrets: inherit

build-macos-arm:
needs: [checks]
needs: [checks, checks_cpp]
name: "Macos-Arm: Build/Test Wheels"
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
Expand All @@ -207,7 +214,7 @@ jobs:
secrets: inherit

build-macos-intel:
needs: [checks]
needs: [checks, checks_cpp]
name: "Macos-Intel: Build/Test Wheels"
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_and_upload_rerun_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ permissions:
jobs:
set-config:
name: Set Config (${{ inputs.PLATFORM }})
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
outputs:
RUNNER: ${{ steps.set-config.outputs.runner }}
TARGET: ${{ steps.set-config.outputs.target }}
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
85 changes: 85 additions & 0 deletions .github/workflows/reusable_checks_cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: "C++ Tests on all platforms & compilers"

on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
MINIMAL:
Wumpf marked this conversation as resolved.
Show resolved Hide resolved
required: false
type: boolean
default: false

workflow_dispatch:
inputs:
CONCURRENCY:
required: false
type: string
default: "adhoc"
MINIMAL:
type: boolean
default: false
description: "If true only linux is tested"

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 minimal C++ test matrix
if: ${{ github.event.inputs.MINIMAL }}
run: echo "matrix=$(jq -c . < ./.github/workflows/cpp_matrix_full.json)" >> $GITHUB_OUTPUT
- name: Load full C++ test matrix
if: ${{ !github.event.inputs.MINIMAL }}
run: echo "matrix=$(jq -c . < ./.github/workflows/cpp_matrix_minimal.json)" >> $GITHUB_OUTPUT
Wumpf marked this conversation as resolved.
Show resolved Hide resolved

cpp-tests:
name: Build rerun-cli (${{ matrix.runner }})
needs: matrix_prep
runs-on: ${{ matrix.runs_on }}
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
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
RERUN_WERROR=ON RERUN_USE_ASAN=ON pixi run cpp-build-all
RERUN_WERROR=ON RERUN_USE_ASAN=ON pixi run cpp-test
Loading