|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: ${{matrix.name}} |
| 12 | + runs-on: ${{matrix.os}} |
| 13 | + container: ${{matrix.container}} |
| 14 | + env: |
| 15 | + CC: ${{matrix.cc}} |
| 16 | + CXX: ${{matrix.cxx}} |
| 17 | + defaults: |
| 18 | + run: |
| 19 | + shell: bash |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - name: gcc-6 |
| 25 | + cc: gcc-6 |
| 26 | + cxx: g++-6 |
| 27 | + os: ubuntu-latest |
| 28 | + container: ubuntu:18.04 |
| 29 | + |
| 30 | + - name: gcc-12 |
| 31 | + cc: gcc-12 |
| 32 | + cxx: g++-12 |
| 33 | + os: ubuntu-latest |
| 34 | + container: ubuntu:22.04 |
| 35 | + # We need relaxed builds for debug mode with current GCC versions, see #218. |
| 36 | + build_options: "relaxed_build=on" |
| 37 | + |
| 38 | + - name: clang-15 |
| 39 | + cc: clang-15 |
| 40 | + cxx: clang++-15 |
| 41 | + os: ubuntu-latest |
| 42 | + container: ubuntu:22.04 |
| 43 | + |
| 44 | + - name: clang-macOS |
| 45 | + cc: clang |
| 46 | + cxx: clang++ |
| 47 | + os: macos-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v3 |
| 51 | + |
| 52 | + - name: Setup (macOS) |
| 53 | + if: matrix.name == 'clang-macOS' |
| 54 | + run: | |
| 55 | + brew install bison flex |
| 56 | + echo "BISON=$(brew --prefix bison)/bin/bison" >> $GITHUB_ENV |
| 57 | + echo "FLEX=$(brew --prefix flex)/bin/flex" >> $GITHUB_ENV |
| 58 | +
|
| 59 | + - name: Setup (Ubuntu) |
| 60 | + if: matrix.name != 'clang-macOS' |
| 61 | + run: | |
| 62 | + apt-get update |
| 63 | + apt-get install --no-install-recommends -y bison flex ${CC} ${CXX} make valgrind |
| 64 | + echo "BISON=bison" >> $GITHUB_ENV |
| 65 | + echo "FLEX=flex" >> $GITHUB_ENV |
| 66 | +
|
| 67 | + - name: System Information |
| 68 | + run: | |
| 69 | + awk -v a=$(uname) 'BEGIN { a == "Linux" ? system("cat /etc/issue") : system("sw_vers") }' |
| 70 | + ${CC} --version |
| 71 | + ${CXX} --version |
| 72 | + ${BISON} --version |
| 73 | + ${FLEX} --version |
| 74 | + awk -v a=$(uname) 'BEGIN { if (a == "Linux") system("valgrind --version") }' |
| 75 | +
|
| 76 | + - name: Build Parser |
| 77 | + run: | |
| 78 | + make -j $(nproc) |
| 79 | + BISON=${BISON} FLEX=${FLEX} make test |
| 80 | + make test_example |
| 81 | +
|
| 82 | + - name: Build Parser and Lexer from Scratch |
| 83 | + run: | |
| 84 | + BISON=${BISON} FLEX=${FLEX} make cleanall |
| 85 | + BISON=${BISON} FLEX=${FLEX} make -j $(nproc) |
| 86 | + BISON=${BISON} FLEX=${FLEX} make test |
| 87 | + make test_example |
| 88 | +
|
| 89 | + - name: Build Parser and Lexer from Scratch (Debug) |
| 90 | + run: | |
| 91 | + BISON=${BISON} FLEX=${FLEX} make cleanall |
| 92 | + BISON=${BISON} FLEX=${FLEX} make -j $(nproc) mode=debug ${{matrix.build_options}} |
| 93 | + BISON=${BISON} FLEX=${FLEX} make test |
| 94 | + make test_example |
0 commit comments