• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2on:
3  push:
4    branches: [main]
5jobs:
6  build-appleclang:
7    runs-on: macos-latest
8    strategy:
9      fail-fast: false
10      matrix:
11        ver: [17, 20]
12    env:
13      CC: clang
14      CXX: clang++
15      # Unlike GCC and upstream Clang, AppleClang still defaults to `-std=c++98`
16      # for some reason. Also, the macOS image on GitHub Actions provides wildly
17      # numbered Xcode versions. Thus, rather than varying the compiler version,
18      # we set the `-std` flag explicitly in order to vary the language version.
19      # (The other two flags are the default provided for CXXFLAGS in Makefile.)
20      CXXFLAGS: -O3 -g -std=c++${{ matrix.ver }}
21    steps:
22      - uses: actions/checkout@v3
23      - name: Install Abseil, GoogleTest and Benchmark
24        run: |
25          brew update
26          brew install abseil googletest google-benchmark
27        shell: bash
28      - run: make && make test
29        shell: bash
30  build-clang:
31    runs-on: ubuntu-latest
32    strategy:
33      fail-fast: false
34      matrix:
35        ver: [15, 16, 17]
36    env:
37      CC: clang-${{ matrix.ver }}
38      CXX: clang++-${{ matrix.ver }}
39    steps:
40      - uses: actions/checkout@v3
41      - name: Install Clang ${{ matrix.ver }}
42        run: |
43          # Avoid `Conflicts: python3-lldb-x.y` between packages.
44          sudo apt purge -y python3-lldb-14
45          wget https://apt.llvm.org/llvm.sh
46          chmod +x ./llvm.sh
47          sudo ./llvm.sh ${{ matrix.ver }}
48        shell: bash
49      - name: Install Abseil, GoogleTest and Benchmark
50        run: |
51          sudo apt update -y
52          sudo apt install -y libabsl-dev libgtest-dev libbenchmark-dev
53        shell: bash
54      - run: make && make test
55        shell: bash
56  build-gcc:
57    runs-on: ubuntu-latest
58    strategy:
59      fail-fast: false
60      matrix:
61        ver: [11, 12, 13]
62    env:
63      CC: gcc-${{ matrix.ver }}
64      CXX: g++-${{ matrix.ver }}
65    steps:
66      - uses: actions/checkout@v3
67      - name: Install Abseil, GoogleTest and Benchmark
68        run: |
69          sudo apt update -y
70          sudo apt install -y libabsl-dev libgtest-dev libbenchmark-dev
71        shell: bash
72      - run: make && make test
73        shell: bash
74