diff options
author | James Mills <prologic@shortcircuit.net.au> | 2020-03-13 07:10:12 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 07:10:12 +1000 |
commit | a133543132c156feb4e56f126d05df43e1b46d99 (patch) | |
tree | 807ce47e2ca3f31b2ccf1be3288c65ac6f7f4c12 /.github | |
parent | 6faecab5150af3e14802199c2255924a83151fc4 (diff) |
Migrate make dist validation to GHA Workflows (#8373)
* Migrate make dist validation to GHA Workflows
* Refactor run_install_with_dist_file.sh
Diffstat (limited to '.github')
-rwxr-xr-x | .github/scripts/run_install_with_dist_file.sh | 37 | ||||
-rw-r--r-- | .github/workflows/checks.yml | 30 |
2 files changed, 67 insertions, 0 deletions
diff --git a/.github/scripts/run_install_with_dist_file.sh b/.github/scripts/run_install_with_dist_file.sh new file mode 100755 index 0000000000..519693f4db --- /dev/null +++ b/.github/scripts/run_install_with_dist_file.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# This script is evaluating netdata installation with the source from make dist +# +# Copyright: SPDX-License-Identifier: GPL-3.0-or-later +# +# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud) + +set -e + +if [ $# -ne 1 ]; then + printf >&2 "Usage: %s <dist_file>\n" "$(basename "$0")" + exit 1 +fi + +distfile="${1}" +shift + +printf >&2 "Opening dist archive %s ... " "${distfile}" +tar -xovf "${distfile}" +distdir="$(echo "${distfile}" | cut -d. -f1,2,3)" +if [ ! -d "${distdir}" ]; then + printf >&2 "ERROR: %s is not a directory" "${distdir}" + exit 2 +fi + +printf >&2 "Entering %s and starting docker run ..." "${distdir}" + +pushd "${distdir}" || exit 1 +docker run \ + -v "${PWD}:/netdata" \ + -w /netdata \ + "netdata/os-test:centos7" \ + /bin/bash -c "./netdata-installer.sh --dont-wait --install /tmp && echo \"Validating netdata instance is running\" && wget -O - 'http://127.0.0.1:19999/api/v1/info' | grep version" +popd || exit 1 + +echo "All Done!" diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6e379d12e3..1c2455e049 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -37,3 +37,33 @@ jobs: - name: Compare generated Dashboard vs. Backed up Dashboard run: | diff -sNrdu /tmp/dashboard.js web/gui/dashboard.js + dist-checks: + name: Dist + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Prepare environment + run: | + ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all + sudo apt-get install -y libjson-c-dev libipmimonitoring-dev libcups2-dev libsnappy-dev \ + libprotobuf-dev libprotoc-dev libssl-dev protobuf-compiler \ + libnetfilter-acct-dev + - name: Configure + run: | + autoreconf -ivf + ./configure \ + --with-zlib \ + --with-math \ + --with-user=netdata \ + CFLAGS=-O2 + - name: Make dist + run: | + make dist + - name: Verify & Set distfile + run: | + ls -lah netdata-*.tar.gz + echo "::set-env name=DISTFILE::$(ls netdata-*.tar.gz)" + - name: Run run_install_with_dist_file.sh + run: | + ./.github/scripts/run_install_with_dist_file.sh "${DISTFILE}" |