summaryrefslogtreecommitdiffstats
path: root/.github/workflows/musl.yml
blob: 930a22e018d2726bff650d15ef97b88ae2d6d4e0 (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: alpine/musl

on:
  push:

permissions:
  contents: read

jobs:
  musl:
      name: gcc
      runs-on: ubuntu-latest
      container:
        image: alpine:latest
        options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
        volumes:
          - /tmp/core:/tmp/core
      steps:
      - name: Setup coredumps
        run: |
          ulimit -c unlimited
          echo '/tmp/core/core.%h.%e.%t' > /proc/sys/kernel/core_pattern
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: apk add gcc gdb make tar git python3 libc-dev linux-headers pcre-dev pcre2-dev openssl-dev lua5.3-dev grep socat curl musl-dbg lua5.3-dbg
      - name: Install VTest
        run: scripts/build-vtest.sh
      - name: Build
        run: make -j$(nproc) TARGET=linux-musl DEBUG_CFLAGS='-ggdb3' CC=cc V=1 USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 USE_OPENSSL=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_PROMEX=1
      - name: Show version
        run: ./haproxy -vv
      - name: Show linked libraries
        run: ldd haproxy
      - name: Install problem matcher for VTest
        # This allows one to more easily see which tests fail.
        run: echo "::add-matcher::.github/vtest.json"
      - name: Run VTest
        id: vtest
        run: make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
      - name: Show coredumps
        if: ${{ failure() && steps.vtest.outcome == 'failure' }}
        run: |
          failed=false
          ls /tmp/core/
          for file in /tmp/core/core.*; do
            failed=true
            printf "::group::"
            gdb -ex 'thread apply all bt full' ./haproxy $file
            echo "::endgroup::"
          done
          if [ "$failed" = true ]; then
            exit 1;
          fi
      - name: Show results
        if: ${{ failure() }}
        run: |
          for folder in /tmp/haregtests-*/vtc.*; do
            printf "::group::"
            cat $folder/INFO
            cat $folder/LOG
            echo "::endgroup::"
          done