summaryrefslogtreecommitdiffstats
path: root/.github/workflows/linux.yml
blob: 8c38da917f98166d874b32c1c8f7cd81a373a357 (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
name: Linux Build
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  linux:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        name: [linux-clang, linux-gcc]
        include:
          - name: linux-clang
            os: ubuntu-22.04
            compiler: clang
            cflags: ''
          - name: linux-gcc
            os: ubuntu-22.04
            compiler: gcc
            cflags: '-Wnonnull'
    steps:
      - name: Clone repository
        uses: actions/checkout@v3
        with:
          submodules: true
      - name: Install packages
        run: |
          sudo apt-get update -qq
          sudo apt-get install -y \
            automake \
            autoconf \
            bison \
            flex \
            gdb \
            python3 \
            valgrind
      - name: Build
        env:
          CC: ${{ matrix.compiler }}
          MAKEVARS: ${{ matrix.makevars }}
        run: |
          autoreconf -fi
          rm src/lexer.c src/lexer.h
          rm src/parser.c src/parser.h
          ./configure --disable-valgrind --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
          make -j4
          make dist
      - name: Test
        env:
          CC: ${{ matrix.compiler }}
          MAKEVARS: ${{ matrix.makevars }}
        run: |
          ulimit -c unlimited
          make -j4 check
      - name: Upload Test Logs
        if: ${{ failure() }}
        uses: actions/upload-artifact@v3
        with:
          name: test-logs
          path: |
            test-suite.log
            tests/*.log
      - name: Upload Artifacts
        uses: actions/upload-artifact@v3
        with:
          name: jq-${{ matrix.name }}
          path: |
            jq