-
Notifications
You must be signed in to change notification settings - Fork 331
63 lines (53 loc) · 2.01 KB
/
c-cpp.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: C/C++ CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, fedora-latest, debian-latest]
configuration: [ Release, Debug ]
compiler: [ gcc, clang ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake autopoint gettext git libtool make texinfo
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo apt-get install -y g++; fi
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo apt-get install -y clang; fi
- name: Install dependencies on Fedora
if: matrix.os == 'fedora-latest'
run: |
sudo dnf update -y
sudo dnf install -y autoconf automake gettext git libtool make texinfo
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo dnf install -y gcc gcc-c++; fi
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo dnf install -y clang; fi
- name: Install dependencies on Debian
if: matrix.os == 'debian-latest'
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake autopoint gettext git libtool make texinfo
if [ "${{ matrix.compiler }}" == "gcc" ]; then sudo apt-get install -y g++; fi
if [ "${{ matrix.compiler }}" == "clang" ]; then sudo apt-get install -y clang; fi
- name: Run autogen
run: ./autogen.sh
- name: Configure
run: |
if [ "${{ matrix.compiler }}" == "gcc" ]; then export CC=gcc CXX=g++; fi
if [ "${{ matrix.compiler }}" == "clang" ]; then export CC=clang CXX=clang++; fi
if [ "${{ matrix.configuration }}" == "Release" ]; then
export CFLAGS="-O2" CXXFLAGS="-O2";
else
export CFLAGS="-g -O0" CXXFLAGS="-g -O0";
fi
./configure
- name: Build
run: make
- name: Run checks
run: make check