summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: a8c05039a641ef1b99dc6cabfc88252d0b4c7221 (plain)
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
name: Build test

on:
  # Trigger the workflow on push or pull requests.
  push:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          - cc: gcc
            cxx: g++
          - cc: clang
            cxx: clang++

    env:
      FLAGS: -g -O2 -Wall -Wextra -Werror

    steps:
    - name: Checkout source
      uses: actions/checkout@v2

    - name: Display compiler versions
      run: |
        ${{matrix.cc}} --version;
        ${{matrix.cxx}} --version;

    - name: Build
      run: |
        ./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}};
        make V=1 -j$(nproc) \
             CPPFLAGS="-Werror" \
             CFLAGS="$FLAGS" \
             CXXFLAGS="$FLAGS";

    - name: Build (32 bit)
      run: |
        sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib -y;
        make clean;
        make V=1 -j$(nproc) \
             CPPFLAGS="-Werror" \
             CFLAGS="$FLAGS -m32" \
             CXXFLAGS="$FLAGS -m32";

    - name: Test install command
      run: |
        sudo make install;