aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/tests.yml
blob: 822c665b2cf7e0aa849162945a0a0ebadd52e602 (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
name: tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: ./scripts/clang-format-check

  autotools:
    strategy:
      matrix:
        os: ["ubuntu-latest", "macos-latest"]
        cc: ["gcc", "clang"]

    runs-on: ${{matrix.os}}

    steps:
      - if: ${{runner.os == 'macOS'}}
        run: brew install autoconf automake libtool
      - uses: actions/checkout@v4
      - run: autoreconf -fi
      - env:
          CC: ${{matrix.cc}}
          CFLAGS: -Werror
        run: ./configure
      - run: make check

  cmake:
    strategy:
      matrix:
        os: ["ubuntu-latest", "macos-latest", "windows-latest"]
        cc: ["gcc", "clang"]
        exclude:
          - os: windows-latest
            cc: gcc
          - os: windows-latest
            cc: clang
        include:
          - os: windows-latest
            cc: 'msvc'  # Doesn't really matter, MSVC is always used on Windows

    runs-on: ${{matrix.os}}

    steps:
      - uses: actions/checkout@v4
      - env:
          CC: ${{matrix.cc}}
        run: cmake .
      - run: cmake --build .
      - run: ctest --output-on-failure

  valgrind:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: sudo apt update && sudo apt install valgrind
      - run: cmake -DJANSSON_TEST_WITH_VALGRIND=ON .
      - run: cmake --build .
      - run: ctest --output-on-failure