summaryrefslogtreecommitdiffstats
path: root/.github/workflows/linux.yml
blob: 6943534d56d31e4a79c5c62a5c3ca25c0f2726e8 (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
76
name: Linux

on:
  push:
    branches: [ "*" ]
    tags: [ "*" ]
  pull_request:
    branches: [ "trunk", "1.7.x" ]

env:
  MARGS: "-j2"

jobs:

  build:
    strategy:
      matrix:
        include: 
          - name: Default
            # Check default shm decision logic for Linux:
            config-output: APR_USE_SHMEM_MMAP_SHM APR_USE_SHMEM_MMAP_ANON
          - name: Static
            config: --enable-static
          - name: Maintainer-mode
            config: --enable-maintainer-mode
          - name: Named SHM - SysV, Maintainer-mode
            config: --enable-maintainer-mode --enable-sysv-shm
            config-output: APR_USE_SHMEM_SHMGET
          - name: Named SHM - Classic mmap, Maintainer-mode
            config: --enable-maintainer-mode ac_cv_func_shm_open=no ac_cv_func_shmget=no
            config-output: APR_USE_SHMEM_MMAP_TMP
          - name: Pool-debug
            config: --enable-pool-debug
          - name: Pool-debug, maintainer-mode
            config: --enable-pool-debug --enable-maintainer-mode
          - name: Maintainer-mode, no IPv6
            config: --enable-maintainer-mode --disable-ipv6
          - name: Maintainer-mode, -Werror
            notest-cflags: -Werror
            config: --enable-maintainer-mode
          - name: ASan
            # w/o ODBC since DSO unload leaks memory and fails the tests
            notest-cflags: -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer -Werror -O2
            config: --with-odbc=no
          - name: ASan, pool-debug
            # w/o ODBC since DSO unload leaks memory and fails the tests
            notest-cflags: -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer -Werror -O2
            config: --enable-pool-debug --with-odbc=no
          - name: UBsan
            notest-cflags: -fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer -Werror -O2
      fail-fast: false

    runs-on: ubuntu-latest
    env:
      NOTEST_CFLAGS: ${{ matrix.notest-cflags }}
    name: ${{ matrix.name }}
    steps:
    - name: Install prerequisites
      run: sudo apt-get install libtool libtool-bin
    - uses: actions/checkout@v4
    # https://github.com/actions/runner-images/issues/9491#issuecomment-1989718917
    - name: Workaround ASAN issue in Ubuntu 22.04 runners
      run: sudo sysctl vm.mmap_rnd_bits=28
    - name: buildconf
      run: ./buildconf
    - name: configure
      run: ./configure --prefix=/tmp/apr ${{ matrix.config }}
    - if: ${{ matrix.config-output != '' }}
      name: check for expected configure output ${{ matrix.config-output }}
      run: for var in ${{ matrix.config-output }}; do grep "^#define *${var} *1" include/apr.h; done
    - name: make
      run: make $MARGS
    - name: install
      run: make install
    - name: check
      run: make check