-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (29 loc) · 1007 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ 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)