aboutsummaryrefslogtreecommitdiff
blob: 4a3ef88007356a2980d70fa93e0bc52942cfd9da (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
77
# GitHub actions workflow.
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions

name: Build+Test CI

#on:
#  push:
#    branches: [master, gh-actions]
#    tags: [v*]
#  pull_request:
#    types: [created, opened, edited, push]

on: [pull_request, push]

jobs:
  glibc:
    strategy:
      matrix:
        os: [ubuntu-latest]
        cc: [gcc, clang]
        sanitize: [none] # [none, asan, ubsan]
      fail-fast: false
    runs-on: ${{ matrix.os }}
    env:
      CC: ${{ matrix.cc }}
      SANITIZER: ${{ matrix.sanitize }}
      UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
    steps:
    - name: Install dependencies
      run: |
        sudo apt-get update -qq
        sudo apt-get install build-essential gcc clang automake autoconf autoconf-archive libtool pax-utils -qy

        case "$SANITIZER" in
          none)
             ;;
          asan)
             echo CFLAGS="-O2 -ggdb3 -fsanitize=address" >> $GITHUB_ENV
             echo CXXFLAGS="-O2 -ggdb3 -fsanitize=address" >> $GITHUB_ENV
             echo LDFLAGS="-fsanitize=address" >> $GITHUB_ENV
             ;;
          ubsan)
             echo CFLAGS="-O2 -ggdb3 -fsanitize=undefined" >> $GITHUB_ENV
             echo CXXFLAGS="-O2 -ggdb3 -fsanitize=undefined" >> $GITHUB_ENV
             echo LDFLAGS="-fsanitize=undefined" >> $GITHUB_ENV
             ;;
        esac

    - uses: actions/checkout@v3
      name: Checkout

    - name: Build
      run: |
        ./autogen.sh
        ./configure || cat config.log
        make V=1
        make V=1 check
        make V=1 distcheck

  musl:
    runs-on: ubuntu-latest
    container:
      image: alpine:latest
      options: --cap-add=SYS_PTRACE
    steps:
      - name: Install dependencies
        run: apk add bash coreutils build-base automake autoconf autoconf-archive libtool pax-utils gawk sed

      - name: Checkout
        uses: actions/checkout@v3

      - name: Build
        run: |
          ./autogen.sh
          ./configure || { cat config.log; false; }
          make V=1
          make V=1 check || { cat tests/testsuite.log; false; }