summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-and-install.yml
blob: 26a144acd1cc7cae891d9569592136c5557f211f (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
name: Builder
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  static-build:
    name: Build (x86_64)
    runs-on: ubuntu-latest
    steps:
      - name: Git clone repository
        uses: actions/checkout@v2
      - run: |
          git fetch --prune --unshallow --tags
      - name: Build
        run: |
          .github/scripts/build-static-x86_64.sh
  source-build:
    name: Build & Install
    strategy:
      fail-fast: false
      matrix:
        distro:
          - 'alpine:edge'
          - 'alpine:3.13'
          - 'alpine:3.12'
          - 'alpine:3.11'
          - 'alpine:3.10'
          - 'archlinux:latest'
          - 'centos:8'
          - 'centos:7'
          - 'clearlinux:latest'
          - 'debian:10'
          - 'debian:9'
          - 'fedora:33'
          - 'fedora:32'
          - 'opensuse/leap:15.2'
          - 'opensuse/tumbleweed:latest'
          - 'ubuntu:20.10'
          - 'ubuntu:20.04'
          - 'ubuntu:18.04'
          - 'ubuntu:16.04'
        include:
          - distro: 'alpine:edge'
            pre: 'apk add -U bash'
            rmjsonc: 'apk del json-c-dev'
          - distro: 'alpine:3.13'
            pre: 'apk add -U bash'
            rmjsonc: 'apk del json-c-dev'
          - distro: 'alpine:3.12'
            pre: 'apk add -U bash'
            rmjsonc: 'apk del json-c-dev'
          - distro: 'alpine:3.11'
            pre: 'apk add -U bash'
            rmjsonc: 'apk del json-c-dev'
          - distro: 'alpine:3.10'
            pre: 'apk add -U bash'
            rmjsonc: 'apk del json-c-dev'

          - distro: 'archlinux:latest'
            pre: 'pacman --noconfirm -Syu && pacman --noconfirm -Sy grep libffi'

          - distro: 'centos:8'
            rmjsonc: 'dnf remove -y json-c-devel'

          - distro: 'debian:10'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'
          - distro: 'debian:9'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'

          - distro: 'fedora:33'
            rmjsonc: 'dnf remove -y json-c-devel'
          - distro: 'fedora:32'
            rmjsonc: 'dnf remove -y json-c-devel'

          - distro: 'opensuse/leap:15.2'
            rmjsonc: 'zypper rm -y libjson-c-devel'
          - distro: 'opensuse/tumbleweed:latest'
            rmjsonc: 'zypper rm -y libjson-c-devel'

          - distro: 'ubuntu:20.10'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'
          - distro: 'ubuntu:20.04'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'
          - distro: 'ubuntu:18.04'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'
          - distro: 'ubuntu:16.04'
            pre: 'apt-get update'
            rmjsonc: 'apt-get remove -y libjson-c-dev'
    runs-on: ubuntu-latest
    steps:
      - name: Git clone repository
        uses: actions/checkout@v2
      - name: install-required-packages.sh on ${{ matrix.distro }}
        env:
          PRE: ${{ matrix.pre }}
          RMJSONC: ${{ matrix.rmjsonc }}
        run: |
          echo $PRE > ./prep-cmd.sh
          echo $RMJSONC > ./rmjsonc.sh && chmod +x ./rmjsonc.sh
          docker build . -f .github/dockerfiles/Dockerfile.build_test -t test --build-arg BASE=${{ matrix.distro }}
      - name: Regular build on ${{ matrix.distro }}
        run: |
          docker run -w /netdata test /bin/sh -c 'autoreconf -ivf && ./configure && make -j2'
      - name: netdata-installer on ${{ matrix.distro }}, disable cloud
        run: |
          docker run -w /netdata test /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud'
      - name: netdata-installer on ${{ matrix.distro }}, require cloud
        run: |
          docker run -w /netdata test /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud'
      - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C
        if: matrix.rmjsonc != ''
        run: |
          docker run -w /netdata test \
              /bin/sh -c '/netdata/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud'
  aws-kinesis-build:
    name: With AWS Kinesis SDK
    strategy:
      fail-fast: false
      matrix:
        distro:
          - 'centos:8'
          - 'debian:buster'
          - 'fedora:32'
          - 'ubuntu:20.04'
        include:
          - distro: 'centos:8'
            pre: >-
              yum -y update &&
              yum -y groupinstall 'Development Tools' &&
              yum -y install libcurl-devel openssl-devel libuuid-devel
            build_kinesis: >-
              git clone https://github.com/aws/aws-sdk-cpp.git &&
              cmake -DCMAKE_INSTALL_PREFIX=/usr
              -DBUILD_ONLY=kinesis
              ./aws-sdk-cpp &&
              make &&
              make install
          - distro: 'debian:buster'
            pre: >-
              apt-get update &&
              DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential &&
              DEBIAN_FRONTEND=noninteractive apt-get install -y libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev
            build_kinesis: >-
              git clone https://github.com/aws/aws-sdk-cpp.git &&
              cmake -DCMAKE_INSTALL_PREFIX=/usr
              -DBUILD_ONLY=kinesis
              ./aws-sdk-cpp &&
              make &&
              make install
          - distro: 'fedora:32'
            pre: >-
              dnf -y update &&
              dnf -y groupinstall 'Development Tools' &&
              dnf -y install libcurl-devel openssl-devel libuuid-devel
            build_kinesis: >-
              git clone https://github.com/aws/aws-sdk-cpp.git &&
              cmake -DCMAKE_INSTALL_PREFIX=/usr
              -DBUILD_ONLY=kinesis
              ./aws-sdk-cpp &&
              make &&
              make install
          - distro: 'ubuntu:20.04'
            pre: >-
              apt-get update &&
              DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential &&
              DEBIAN_FRONTEND=noninteractive apt-get install -y libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev
            build_kinesis: >-
              git clone https://github.com/aws/aws-sdk-cpp.git &&
              cmake -DCMAKE_INSTALL_PREFIX=/usr
              -DBUILD_ONLY=kinesis
              ./aws-sdk-cpp &&
              make &&
              make install
    runs-on: ubuntu-latest
    steps:
      - name: Git clone repository
        uses: actions/checkout@v2
      - name: install-required-packages.sh on ${{ matrix.distro }}
        env:
          PRE: ${{ matrix.pre }}
          BUILD_KINESIS: ${{ matrix.build_kinesis }}
        run: |
          echo $PRE > ./prep-cmd.sh
          echo $BUILD_KINESIS > ./build-kinesis.sh && chmod +x ./build-kinesis.sh
          docker build . -f .github/dockerfiles/Dockerfile.build_test -t test --build-arg BASE=${{ matrix.distro }}
      - name: Build on ${{ matrix.distro }}
        env:
          RUNCMD: >-
            ./build-kinesis.sh &&
            ./netdata-installer.sh --dont-wait --dont-start-it --enable-backend-kinesis
        run: |
          docker run -w /netdata test \
            /bin/sh -c "$RUNCMD"