Sign source release tarballs with Sigstore (#249) #538
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" ] | |
| workflow_dispatch: | |
| jobs: | |
| build-linux-amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - 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@v7 | |
| with: | |
| name: build-PC-artifacts | |
| path: build-pc.tar | |
| build-windows: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - 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@v7.0.1 | |
| - 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-linux-s390x: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Install s390x toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross | |
| - name: Build (crosscompile) PC Linux s390x | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release | |
| cmake --build ${{github.workspace}}/build-s390x | |
| build-darwin-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - 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@v7.0.1 | |
| - 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@v7.0.1 | |
| - 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@v7 | |
| with: | |
| name: coverage-report | |
| path: ${{github.workspace}}/build/coverage.info | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: LastTest.log | |
| path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log | |
| test-linux-s390x: | |
| runs-on: ubuntu-latest | |
| env: | |
| QEMU_LD_PREFIX: /usr/s390x-linux-gnu | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Install s390x toolchain and emulator | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross qemu-user qemu-user-static | |
| - name: Build (crosscompile) PC Linux s390x for tests | |
| run: | | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-s390x;-L;/usr/s390x-linux-gnu" | |
| cmake --build ${{github.workspace}}/build-s390x | |
| - name: Run tests for s390x | |
| run: | | |
| cd build-s390x | |
| ctest --output-on-failure --timeout 15 |