Final product #91
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: CI/CD R-Type (rteng) | |
| on: | |
| pull_request: | |
| branches: ["main", "dev"] | |
| push: | |
| branches: ["*rteng*"] | |
| jobs: | |
| build-and-test-on-rteng: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false # If one failed, don't cancel the other jobs (Kinda like a debug option) | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Checkout doesn't fetch submodules so it has to be done manually | |
| - name: Install system dependencies (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| ninja-build \ | |
| pkg-config \ | |
| g++-15 | |
| - name: Install system dependencies (Mac) | |
| if: matrix.os == 'macos-latest' | |
| run: brew install cmake ninja | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Conan | |
| run: pip install conan | |
| - name: Configure Conan Profile | |
| run: conan profile detect --force | |
| - name: Get Conan home | |
| id: conan_home | |
| shell: bash | |
| run: | | |
| echo "home=$(conan config home)" >> $GITHUB_OUTPUT | |
| - name: Cache Conan packages | |
| id: cache-conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.conan_home.outputs.home }} | |
| key: conan-${{ matrix.os }}-${{ hashFiles('conanfile.txt') }} | |
| restore-keys: | | |
| conan-${{ matrix.os }}- | |
| - name: Install all dependencies with conan | |
| shell: bash | |
| run: | | |
| conan install lib/rteng \ | |
| --output-folder=lib/rteng/build \ | |
| --build=missing \ | |
| -s build_type=Release \ | |
| -s compiler.cppstd=23 \ | |
| -c tools.system.package_manager:mode=install \ | |
| -c tools.system.package_manager:sudo=True | |
| - name: Configure CMake | |
| shell: bash | |
| run: cmake -S lib/rteng -B lib/rteng/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DRTENG_BUILD_TESTS=ON | |
| - name: Build Project | |
| shell: bash | |
| run: cmake --build lib/rteng/build --config Release --parallel | |
| - name: Run Tests | |
| working-directory: lib/rteng/build | |
| run: ctest --output-on-failure -C Release | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rteng-binaries-${{ matrix.os }} | |
| path: | | |
| lib/rteng/build/lib/librteng.a | |
| lib/rteng/build/tests/rteng_tests | |
| lib/rteng/build/tests/logs/latest.log | |
| retention-days: 5 | |
| if-no-files-found: warn |