CMake: install the libraries in prefix/lib #364
Workflow file for this run
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@v5 | |
| - 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@v5 | |
| - 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@v5 | |
| - 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-13-xlarge | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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-13-xlarge | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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 | |
| needs: build-linux-amd64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: build-PC-artifacts | |
| - name: Run tests for PC | |
| run: | | |
| tar -xvf build-pc.tar | |
| cd build | |
| ctest | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: LastTest.log | |
| path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log |