summaryrefslogtreecommitdiffstats
path: root/.github/workflows/macos.yml
blob: 9c6a93658bcb03d49d385444ebc707f54fdec29a (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
name: MacOS Build
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  macos:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        name: [macos-12-clang, macos-13-clang]
        include:
          - name: macos-12-clang
            os: macos-12
            compiler: clang
          - name: macos-13-clang
            os: macos-13
            compiler: clang
    steps:
      - name: Clone repository
        uses: actions/checkout@v3
        with:
          submodules: true
      - name: Install packages
        run: |
          brew update
          brew install autoconf automake libtool flex bison
          sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
      - 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="$(brew --prefix)/opt/bison/bin/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