-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some of the CI setup into the CMakePresets.json setup. This should make it more clear that there is no magic going, and we are just testing many different CMake configurations with corrosion. Additionally add some needs dependencies to order some of jobs and skip them if the predecessor failed.
- Loading branch information
Showing
13 changed files
with
662 additions
and
344 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
set(CMAKE_C_COMPILER "clang") | ||
set(CMAKE_CXX_COMPILER "clang++") | ||
set(CMAKE_C_COMPILER_TARGET "aarch64-apple-darwin") | ||
set(CMAKE_CXX_COMPILER_TARGET "aarch64-apple-darwin") | ||
set(CMAKE_SYSTEM_NAME "Darwin") | ||
set(CMAKE_SYSTEM_VERSION ${CMAKE_HOST_SYSTEM_VERSION}) | ||
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "") |
4 changes: 4 additions & 0 deletions
4
.github/scripts/toolchains/aarch64-unknown-linux-gnu-clang.cmake
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,4 @@ | ||
set(CMAKE_C_COMPILER "clang") | ||
set(CMAKE_CXX_COMPILER "clang++") | ||
set(CMAKE_C_COMPILER_TARGET "aarch64-linux-gnu") | ||
set(CMAKE_CXX_COMPILER_TARGET "aarch64-linux-gnu") |
3 changes: 3 additions & 0 deletions
3
.github/scripts/toolchains/aarch64-unknown-linux-gnu-gcc.cmake
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,3 @@ | ||
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc") | ||
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++") | ||
set(CMAKE_SYSTEM_NAME "Linux") |
4 changes: 4 additions & 0 deletions
4
.github/scripts/toolchains/i686-unknown-linux-gnu-clang.cmake
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,4 @@ | ||
set(CMAKE_C_COMPILER "clang") | ||
set(CMAKE_CXX_COMPILER "clang++") | ||
set(CMAKE_C_COMPILER_TARGET "i686-pc-linux-gnu") | ||
set(CMAKE_CXX_COMPILER_TARGET "i686-pc-linux-gnu") |
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,3 @@ | ||
set(CMAKE_C_COMPILER "i686-linux-gnu-gcc") | ||
set(CMAKE_CXX_COMPILER "i686-linux-gnu-g++") | ||
set(CMAKE_SYSTEM_NAME "Linux") |
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,3 @@ | ||
set(CMAKE_C_COMPILER "clang") | ||
set(CMAKE_CXX_COMPILER "clang++") | ||
set(CMAKE_C_COMPILER_TARGET "x86_64-pc-win32-gnu") |
3 changes: 3 additions & 0 deletions
3
.github/scripts/toolchains/x86_64-unknown-linux-gnu-clang.cmake
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,3 @@ | ||
# Assumption: This is the native host target. | ||
set(CMAKE_C_COMPILER "clang") | ||
set(CMAKE_CXX_COMPILER "clang++") |
3 changes: 3 additions & 0 deletions
3
.github/scripts/toolchains/x86_64-unknown-linux-gnu-gcc.cmake
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,3 @@ | ||
# Assumption: This is the native host target. | ||
set(CMAKE_C_COMPILER "gcc") | ||
set(CMAKE_CXX_COMPILER "g++") |
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,58 @@ | ||
# Workflow file for Linux hosts | ||
name: Corrosion on Linux | ||
on: | ||
workflow_call: | ||
inputs: | ||
ubuntu_version: | ||
required: false | ||
type: string | ||
default: "latest" | ||
cmake: | ||
required: false | ||
type: string | ||
default: "3.22.6" | ||
generator: | ||
required: true | ||
type: string | ||
c_compiler: | ||
required: true | ||
type: string | ||
rust: | ||
required: false | ||
type: string | ||
default: 1.46.0 | ||
target_arch: | ||
required: false | ||
type: string | ||
default: x86_64 | ||
|
||
jobs: | ||
linux: | ||
name: Test Linux | ||
runs-on: ubuntu-${{ inputs.ubuntu_version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install CMake | ||
uses: corrosion-rs/install-cmake@v2 | ||
with: | ||
cmake: ${{ inputs.cmake }} | ||
ninja: 1.10.0 | ||
- name: Install Rust | ||
id: install_rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{inputs.rust}} | ||
targets: ${{inputs.target_arch}}-unknown-linux-gnu | ||
- name: Install Cross Compiler | ||
shell: bash | ||
run: | | ||
echo "::group::apt-install" | ||
sudo apt-get update | ||
sudo apt-get install -y "g++-${{inputs.target_arch}}-linux-gnu" | ||
echo "::endgroup::" | ||
if: ${{ 'Linux' == runner.os && inputs.target_arch != 'x86_64' }} | ||
- name: Configure Corrosion | ||
run: cmake -S. -Bbuild -G "${{ inputs.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ inputs.target_arch }}-unknown-linux-gnu-${{ inputs.c_compiler }}" | ||
- name: Run Tests | ||
working-directory: build | ||
run: ctest --output-on-failure --build-config Debug -j 3 |
Oops, something went wrong.