summaryrefslogtreecommitdiff
path: root/.github/workflows/testsuite.yaml
blob: 73af29fea8adb9d60f52403916c2c66b58e00f3e (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Test suite
on:
  pull_request:
  push:
  schedule:
    - cron: '0 16 * * 5'

jobs:
  gcc:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [9, 10, 11, 12]
        use_native_chk: [true, false]
    steps:
      - name: Checking out the code
        uses: actions/checkout@v3
      - name: Cache musl toolchain
        uses: actions/cache@v3
        id: cache-musl
        with:
          path: x86_64-linux-musl-native
          key: musl
      - name: Downloading musl-based toolchain
        if: steps.cache-musl.outputs.cache-hit != 'true'
        run: wget --quiet https://musl.cc/x86_64-linux-musl-native.tgz
      - name: Extracting musl-based toolchain
        if: steps.cache-musl.outputs.cache-hit != 'true'
        run: tar xzf ./x86_64-linux-musl-native.tgz
      - name: Setting up gcc version
        run: |
          sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 100
          sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100
      - name: Build with native chk
        if: ${{ matrix.use_native_chk == true }}
        shell: bash
        run: make CFLAGS=-DUSE_NATIVE_CHK -C tests gcc
      - name: Build without native chk, and run the testsuite
        if: ${{ matrix.use_native_chk == false }}
        shell: bash
        run: make -C tests gcc run

  clang:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [13, 14, 15]
        use_native_chk: [true, false]
    steps:
      - name: Checking out the code
        uses: actions/checkout@v3
      - name: Cache musl toolchain
        uses: actions/cache@v3
        id: cache-musl
        with:
          path: x86_64-linux-musl-native
          key: musl
      - name: Downloading musl-based toolchain
        if: steps.cache-musl.outputs.cache-hit != 'true'
        run: wget --quiet https://musl.cc/x86_64-linux-musl-native.tgz
      - name: Extracting musl-based toolchain
        if: steps.cache-musl.outputs.cache-hit != 'true'
        run: tar xzf ./x86_64-linux-musl-native.tgz
      - name: Setting up clang version
        run: |
          sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{ matrix.version }} 100
          sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ matrix.version }} 100
      - name: Build with native chk
        if: ${{ matrix.use_native_chk == true }}
        shell: bash
        run: make CFLAGS=-DUSE_NATIVE_CHK -C tests clang
      - name: Building and running without native chk
        if: ${{ matrix.use_native_chk == false }}
        shell: bash
        run: make -C tests clang run