|
| 1 | +name: Test suite |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + push: |
| 5 | + schedule: |
| 6 | + - cron: '0 16 * * 5' |
| 7 | + |
| 8 | +jobs: |
| 9 | + gcc: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + version: [9, 10, 11, 12, 13, 14] |
| 14 | + steps: |
| 15 | + - name: Checking out the code |
| 16 | + uses: actions/checkout@v3 |
| 17 | + - name: Cache musl toolchain |
| 18 | + uses: actions/cache@v3 |
| 19 | + id: cache-musl |
| 20 | + with: |
| 21 | + path: x86_64-linux-musl-native |
| 22 | + key: musl |
| 23 | + - name: Downloading musl-based toolchain |
| 24 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 25 | + run: wget --quiet https://dustri.org/x86_64-linux-musl-native.tgz |
| 26 | + - name: Extracting musl-based toolchain |
| 27 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 28 | + run: tar xzf ./x86_64-linux-musl-native.tgz |
| 29 | + - name: Setting up gcc version |
| 30 | + run: | |
| 31 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 32 | + sudo apt update |
| 33 | + sudo apt install -y --no-install-recommends gcc-${{ matrix.version }} g++-${{ matrix.version }} |
| 34 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 100 |
| 35 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 |
| 36 | + - name: Build and run the testsuite |
| 37 | + run : make --silent -C tests clean gcc run | tee ./results.txt |
| 38 | + - name: Check the testsuite's output |
| 39 | + shell: bash |
| 40 | + run: grep -zvq 'FAIL' ./results.txt |
| 41 | + - name: Show logs in case of failure |
| 42 | + if: ${{ failure() }} |
| 43 | + run: cat ./results.txt |
| 44 | + |
| 45 | + |
| 46 | + clang: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + version: [16, 17, 18] |
| 51 | + steps: |
| 52 | + - name: Checking out the code |
| 53 | + uses: actions/checkout@v3 |
| 54 | + - name: Cache musl toolchain |
| 55 | + uses: actions/cache@v3 |
| 56 | + id: cache-musl |
| 57 | + with: |
| 58 | + path: x86_64-linux-musl-native |
| 59 | + key: musl |
| 60 | + - name: Downloading musl-based toolchain |
| 61 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 62 | + run: wget --quiet https://dustri.org/x86_64-linux-musl-native.tgz |
| 63 | + - name: Extracting musl-based toolchain |
| 64 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 65 | + run: tar xzf ./x86_64-linux-musl-native.tgz |
| 66 | + - name: Setting up clang version |
| 67 | + run: | |
| 68 | + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{ matrix.version }} 100 |
| 69 | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ matrix.version }} 100 |
| 70 | + - name: Build and run the testsuite |
| 71 | + run : make --silent -C tests clean clang run | tee ./results.txt |
| 72 | + - name: Check the testsuite's output |
| 73 | + shell: bash |
| 74 | + run: grep -zvq 'FAIL' ./results.txt |
| 75 | + - name: Show logs in case of failure |
| 76 | + if: ${{ failure() }} |
| 77 | + run: cat ./results.txt |
| 78 | + |
| 79 | + c_versions: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + strategy: |
| 82 | + matrix: |
| 83 | + version: ["c89", "c99", "c11", "c17"] |
| 84 | + steps: |
| 85 | + - name: Checking out the code |
| 86 | + uses: actions/checkout@v3 |
| 87 | + - name: Cache musl toolchain |
| 88 | + uses: actions/cache@v3 |
| 89 | + id: cache-musl |
| 90 | + with: |
| 91 | + path: x86_64-linux-musl-native |
| 92 | + key: musl |
| 93 | + - name: Downloading musl-based toolchain |
| 94 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 95 | + run: wget --quiet https://dustri.org/x86_64-linux-musl-native.tgz |
| 96 | + - name: Extracting musl-based toolchain |
| 97 | + if: steps.cache-musl.outputs.cache-hit != 'true' |
| 98 | + run: tar xzf ./x86_64-linux-musl-native.tgz |
| 99 | + - name: Building with clang |
| 100 | + shell: bash |
| 101 | + run: CFLAGS=-std=${{ matrix.version }} make -C tests clean clang run |
| 102 | + - name: Building with gcc |
| 103 | + shell: bash |
| 104 | + run: CFLAGS=-std=${{ matrix.version }} make -C tests clean gcc run |
0 commit comments