summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: f20068cdaf89e944a176627ef749a4445fc863b8 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright (c) 2021 Petr Vorel <pvorel@suse.cz>

name: "CI: docker based builds"
on: [push, pull_request]

jobs:
  job:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          # cross compilation builds
          - container: "debian:testing"
            env:
              ARCH: arm64
              CC: aarch64-linux-gnu-gcc
              VARIANT: cross-compile

          - container: "debian:testing"
            env:
              ARCH: ppc64el
              CC: powerpc64le-linux-gnu-gcc
              VARIANT: cross-compile

          - container: "debian:testing"
            env:
              ARCH: s390x
              CC: s390x-linux-gnu-gcc
              VARIANT: cross-compile

          # musl (native)
          - container: "alpine:latest"
            env:
              CC: gcc
              EXTRA_BUILD_OPTS: "-DBUILD_HTML_MANS=false -DBUILD_MANS=false"

          # some non-default options
          - container: "debian:stable"
            env:
              CC: gcc
              EXTRA_BUILD_OPTS: "-DUSE_CAP=false -DUSE_IDN=false -DBUILD_ARPING=false -DBUILD_CLOCKDIFF=false -DNO_SETCAP_OR_SUID=true -DUSE_GETTEXT=false"

          # other builds
          - container: "opensuse/leap"
            env:
              CC: clang

          - container: "ubuntu:bionic"
            env:
              CC: clang
              EXTRA_BUILD_OPTS: "-DUSE_GETTEXT=false"
              # meson error: not using Unicode-compatible locale (ANSI_X3.4-1968)
              SKIP_TESTS: true

          - container: "ubuntu:jammy"
            env:
              CC: gcc

          - container: "fedora:latest"
            env:
              CC: clang

          - container: "centos:7"
            env:
              CC: gcc

          - container: "debian:testing"
            env:
              CC: gcc

          - container: "debian:stable"
            env:
              CC: gcc

          - container: "debian:oldstable"
            env:
              CC: clang

    container:
      image: ${{ matrix.container }}
      env: ${{ matrix.env }}
      options: --security-opt seccomp=unconfined

    steps:
    - name: Show OS
      run: cat /etc/os-release

    - name: Git checkout
      uses: actions/checkout@v1

    - name: Install additional packages
      run: |
        export INSTALL=${{ matrix.container }}
        export DISTRO_VERSION="${INSTALL#*:}"
        INSTALL="${INSTALL%%:*}"
        INSTALL="${INSTALL%%/*}"
        ./ci/$INSTALL.sh
        if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi

    - name: Check dependencies
      run: ./build.sh dependencies

    - name: Check info
      run: ./build.sh info

    - name: Configure
      run: ./build.sh configure

    - name: Compile
      run: ./build.sh build

    - name: Show build log
      run: ./build.sh build-log

    - name: Install
      run: ./build.sh install

    - name: Show install log
      run: ./build.sh install-log

    - name: Run tests
      run: if [ ! "$SKIP_TESTS" ]; then ./build.sh test; else echo "tests skipped"; fi

    - name: Show test log
      run: ./build.sh test-log