summaryrefslogtreecommitdiff
path: root/.github/workflows/makefile.yml
blob: e32f3ef60bd6dfb15627b38e2e820b9d9907faf0 (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
name: Makefile CI
on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu, macos]
        toolchain: [gcc, llvm]
        include:
          - os: ubuntu
            toolchain: gcc
            install_cmd: |
              sudo apt update
              sudo apt install g++
            CXX: g++
          - os: ubuntu
            toolchain: llvm
            install_cmd: |
              sudo apt update
              sudo apt install clang
            CXX: clang++
          - os: macos
            toolchain: gcc
            install_cmd: |
              brew update
              brew install gcc
            CXX: g++
          - os: macos
            toolchain: llvm
            install_cmd: |
              brew update
              brew install llvm
            CXX: clang++
    runs-on: ${{ matrix.os }}-latest
    steps:
    - uses: actions/checkout@v3
    - name: Install dependencies
      run: ${{ matrix.install_cmd }}
    - name: Build and test
      run: make CXX=${{ matrix.CXX }} -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) test