summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: f82d0e6f4ff9f421e2c6e122de96f2d8d2b83b47 (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
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: Test install command
      run: |
        sudo make install