Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioSieg committed Feb 18, 2025
1 parent 231a5a7 commit c2911b5
Showing 1 changed file with 38 additions and 112 deletions.
150 changes: 38 additions & 112 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,111 +13,25 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-latest, windows-2019, macos-latest, macos-14, macos-13, ubuntu-24.04-arm, ubuntu-22.04-arm]
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, ubuntu-24.04-arm, ubuntu-22.04-arm]
build_type: [Release]
c_compiler: [gcc, clang, cl]
cpp_compiler: [g++, clang++, cl]
compiler: [gcc, clang]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
build_type: Release
compiler: cl
- os: windows-2019
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-22.04
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-22.04
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-20.04
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-20.04
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-24.04-arm
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-24.04-arm
c_compiler: clang
cpp_compiler: clang++
- os: ubuntu-22.04-arm
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-22.04-arm
c_compiler: clang
cpp_compiler: clang++
build_type: Release
compiler: cl
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
build_type: Release
compiler: clang
- os: macos-14
c_compiler: clang
cpp_compiler: clang++
build_type: Release
compiler: clang
- os: macos-13
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
cpp_compiler: g++
- os: windows-latest
c_compiler: clang
cpp_compiler: g++
- os: windows-2019
c_compiler: gcc
cpp_compiler: g++
- os: windows-2019
cpp_compiler: g++
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-24.04
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-22.04
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-20.04
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-22.04-arm
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-24.04-arm
c_compiler: cl
cpp_compiler: cl
- os: macos-latest
c_compiler: gcc
cpp_compiler: g++
- os: macos-latest
c_compiler: cl
cpp_compiler: cl
- os: macos-14
c_compiler: gcc
cpp_compiler: g++
- os: macos-14
c_compiler: cl
cpp_compiler: cl
- os: macos-13
c_compiler: gcc
cpp_compiler: g++
- os: macos-13
c_compiler: cl
cpp_compiler: cl
build_type: Release
compiler: clang

steps:
- uses: actions/checkout@v4
Expand All @@ -127,25 +41,37 @@ jobs:
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
shell: bash
run: |
# Map the matrix "compiler" to C and C++ compiler settings.
if [ "${{ matrix.compiler }}" = "gcc" ]; then
CC=gcc
CXX=g++
elif [ "${{ matrix.compiler }}" = "clang" ]; then
# Note: On Windows, we explicitly set compiler to "cl"
CC=clang
CXX=clang++
else
CC=cl
CXX=cl
fi
cmake -B "${{ steps.strings.outputs.build-output-dir }}" \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-S "${{ github.workspace }}"
- name: Build C++ Runtime
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j4
run: cmake --build "${{ steps.strings.outputs.build-output-dir }}" --config ${{ matrix.build_type }} -j4

- name: Prepare C++ Test Data
run: cp -r ${{ github.workspace }}/test_data ${{ steps.strings.outputs.build-output-dir }}/test/unit/test_data
run: cp -r "${{ github.workspace }}/test_data" "${{ steps.strings.outputs.build-output-dir }}/test/unit/test_data"

- name: Run C++ Runtime Tests
working-directory: ${{ steps.strings.outputs.build-output-dir }}
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest --build-config ${{ matrix.build_type }} --verbose

- name: Setup Python Virtual Environment
Expand All @@ -161,15 +87,15 @@ jobs:
shell: bash
run: |
. .venv/bin/activate
cd ${{ github.workspace }}/python/magnetron_framework
cd "${{ github.workspace }}/python/magnetron_framework"
pip wheel --verbose -w dist .
- name: Install Python wheel
if: runner.os != 'windows'
shell: bash
run: |
. .venv/bin/activate
pip install ${{ github.workspace }}/python/magnetron_framework/dist/*.whl
pip install "${{ github.workspace }}/python/magnetron_framework/dist/"*.whl
- name: Install Pytest
if: runner.os != 'windows'
Expand All @@ -183,4 +109,4 @@ jobs:
shell: bash
run: |
. .venv/bin/activate
python -m pytest ${{ github.workspace }}/python/tests/*
python -m pytest "${{ github.workspace }}/python/tests/"

0 comments on commit c2911b5

Please sign in to comment.