ci: Update runners for macOS #383
This file contains hidden or 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
| name: Build and test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build-linux-amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Build PC (Linux) | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build | |
| - name: Tar files | |
| run: tar -cvf build-pc.tar . | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: build-PC-artifacts | |
| path: build-pc.tar | |
| build-windows: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Install Windows toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y mingw-w64 mingw-w64-tools | |
| - name: Build (crosscompile) PC Windows | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-windows -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/windows_x86_64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build-windows | |
| build-linux-arm64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Install ARM toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | |
| - name: Build (crosscompile) PC Linux ARM64 | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-arm -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/arm64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build-arm | |
| build-darwin-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build macOS ARM64 (Apple Silicon) | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-darwin -DUNIVERSAL=FALSE -DCMAKE_OSX_ARCHITECTURES=arm64 -DARM=1 -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build-darwin | |
| build-darwin-universal: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build macOS Universal (ARM64 + AMD64) | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=macos_universal_toolchain.cmake -DUNIVERSAL=1 -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Build PC (Linux) for coverage | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DENABLE_COVERAGE=ON | |
| cmake --build ${{github.workspace}}/build | |
| - name: Run tests for PC | |
| run: | | |
| cd build | |
| ctest | |
| - name: Generate coverage report | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lcov | |
| lcov --capture --directory ${{github.workspace}}/build --output-file ${{github.workspace}}/build/coverage.info | |
| lcov --remove ${{github.workspace}}/build/coverage.info '/usr/*' --output-file ${{github.workspace}}/build/coverage.info | |
| lcov --list ${{github.workspace}}/build/coverage.info | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: coverage-report | |
| path: ${{github.workspace}}/build/coverage.info | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: LastTest.log | |
| path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log |