CI: Use gcc-10 as the minimum compiler in CI #411
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
| # Compile project on Ubuntu | |
| name: Ubuntu | |
| on: | |
| # Branch pushes that do not only modify other workflow files | |
| push: | |
| branches: | |
| - '**' | |
| paths: | |
| - "**" | |
| - "!.github/**" | |
| - ".github/workflows/Ubuntu.yml" | |
| # Disabled for now. See https://github.com/FLAMEGPU/FLAMEGPU2/pull/644 | |
| # pull_request: | |
| # Allow manual invocation. | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.cudacxx.os }} | |
| strategy: | |
| fail-fast: false | |
| # Multiplicative build matrix | |
| # optional exclude: can be partial, include: must be specific | |
| matrix: | |
| cudacxx: | |
| # CUDA 13.x | |
| - cuda: "13.0" | |
| cuda_arch: "75" | |
| hostcxx: gcc-13 | |
| os: ubuntu-24.04 | |
| # Oldest and newest CUDA 12.x | |
| - cuda: "12.9" | |
| cuda_arch: "120" | |
| hostcxx: gcc-12 | |
| os: ubuntu-24.04 | |
| - cuda: "12.0" | |
| cuda_arch: "50" | |
| hostcxx: gcc-10 | |
| os: ubuntu-22.04 | |
| config: | |
| - name: "Release" | |
| config: "Release" | |
| # Name the job based on matrix/env options | |
| name: "build (${{ matrix.cudacxx.cuda }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})" | |
| # Define job-wide env constants, and promote matrix elements to env constants for portable steps. | |
| env: | |
| # Define constants | |
| BUILD_DIR: "build" | |
| # Port matrix options to environment, for more portability. | |
| CUDA: ${{ matrix.cudacxx.cuda }} | |
| CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }} | |
| HOSTCXX: ${{ matrix.cudacxx.hostcxx }} | |
| OS: ${{ matrix.cudacxx.os }} | |
| CONFIG: ${{ matrix.config.config }} | |
| # Kept for portable steps between this and the main repository. | |
| VISUALISATION: "ON" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install CUDA | |
| if: ${{ startswith(env.OS, 'ubuntu') && env.CUDA != '' }} | |
| env: | |
| cuda: ${{ env.CUDA }} | |
| run: .github/scripts/install_cuda_ubuntu.sh | |
| - name: Install/Select gcc and g++ | |
| if: ${{ startsWith(env.HOSTCXX, 'gcc-') }} | |
| run: | | |
| gcc_version=${HOSTCXX//gcc-/} | |
| sudo apt-get install -y gcc-${gcc_version} g++-${gcc_version} | |
| echo "CC=/usr/bin/gcc-${gcc_version}" >> $GITHUB_ENV | |
| echo "CXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV | |
| echo "CUDAHOSTCXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV | |
| - name: Install Visualisation Dependencies | |
| if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} | |
| run: | | |
| # Install ubuntu-24.04 packages | |
| if [ "$OS" == 'ubuntu-24.04' ]; then | |
| sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev | |
| fi | |
| # Install ubuntu-22.04 packages | |
| if [ "$OS" == 'ubuntu-22.04' ]; then | |
| sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev | |
| fi | |
| - name: Add custom problem matchers for annotations | |
| run: echo "::add-matcher::.github/problem-matchers.json" | |
| - name: Configure cmake | |
| run: > | |
| cmake . -B "${{ env.BUILD_DIR }}" | |
| -DCMAKE_BUILD_TYPE="${{ env.CONFIG }}" | |
| -Werror=dev | |
| -DCMAKE_WARN_DEPRECATED="OFF" | |
| -DFLAMEGPU_WARNINGS_AS_ERRORS="ON" | |
| -DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}" | |
| - name: Build | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: cmake --build . --target all --verbose -j `nproc` |