summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: b5157cb2b06f24810972ae2c558694d25a11878b (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
53
54
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 -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS";

    - name: Build nolibc x86-64
      run: |
        ./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}} --nolibc;
        make -j$(nproc) V=1 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;