| name: Build and test |
| |
| on: |
| push: |
| branches: [ "main" ] |
| pull_request: |
| branches: [ "main" ] |
| |
| jobs: |
| build-linux: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| |
| - 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@v4 |
| with: |
| name: build-PC-artifacts |
| path: build-pc.tar |
| |
| build-windows: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| |
| - 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 (crosscmopile) 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-arm: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| |
| - 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 ARM |
| 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 |
| |
| test-linux: |
| runs-on: ubuntu-latest |
| needs: build-linux |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| |
| - name: Set up CMake |
| uses: jwlawson/actions-setup-cmake@v2 |
| |
| - name: Download build artifacts |
| uses: actions/download-artifact@v4 |
| 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@v4 |
| with: |
| name: LastTest.log |
| path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log |