Test building with multiple gcc versions #7
Workflow file for this run
This file contains 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: C/C++ CI | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
pull_request: | |
branches: [ "master", "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
gcc-version: [7, 8, 9, 10, 11, 12, 13] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install GCC ${{ matrix.gcc-version }} | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt update | |
sudo apt install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc-version }} | |
sudo update-alternatives --set gcc /usr/bin/gcc-${{ matrix.gcc-version }} | |
- name: Check GCC version | |
run: | | |
gcc --version | |
g++ --version | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y libsdl2-dev | |
- name: Build project | |
run: make -j$(nproc) |