Migrate Travis based checks to Github Actions (#8329)
* Migrate Travis based checks to Github Actions * Remove Gitlab CI config * Remove ./build/build.sh and use simple shell to do consistency checks on Dashbaord JS * Install prereq deps * Rename job * Fix brain fart momemt * Split Dashboard checks into a separate job
James Mills committed
Mar 9, 2020 at 21:35 UTC
e183d7499e4568a31b595e946eaa145356f436ce
4 files changed
+39
-56
.github/workflows/checks.yml
new
+39
@@ -0,0 +1,39 @@
1
+---
2
+name: Checks
3
+on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+jobs:
9
+ checksum-checks:
10
+ name: Checksums
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Git clone repository
14
+ uses: actions/checkout@v2
15
+ - name: Run checksum checks on kickstart files
16
+ env:
17
+ LOCAL_ONLY: "true"
18
+ run: |
19
+ ./tests/installer/checksums.sh
20
+ dashboard-checks:
21
+ name: Dashboard
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Git clone repository
25
+ uses: actions/checkout@v2
26
+ - name: Install required packages
27
+ run: |
28
+ ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
29
+ - name: Backup dashboard.js
30
+ run: |
31
+ cp web/gui/dashboard.js /tmp/dashboard.js
32
+ - name: Regenerate dashboard.js
33
+ run: |
34
+ autoreconf -ivf
35
+ ./configure --enable-maintainer-mode
36
+ make dist
37
+ - name: Compare generated Dashboard vs. Backed up Dashboard
38
+ run: |
39
+ diff -sNrdu /tmp/dashboard.js web/gui/dashboard.js
.gitlab-ci.yml
deleted
-19
@@ -1,19 +0,0 @@
1
-stages:
2
- - "Code quality, linting, syntax, code style"
3
-
4
-job 1:
5
- stage: "Code quality, linting, syntax, code style"
6
- before_script:
7
- - apt-get clean all && apt-get update
8
- - apt-get install -y shellcheck
9
- script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
10
-
11
-job 2:
12
- stage: "Code quality, linting, syntax, code style"
13
- script: ./tests/installer/checksums.sh
14
- variables:
15
- LOCAL_ONLY: "true"
16
-
17
-job 3:
18
- stage: "Code quality, linting, syntax, code style"
19
- script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
.travis.yml
-17
@@ -46,7 +46,6 @@ notifications:
46
#
47
stages:
48
# Mandatory runs, we always want these executed
49
- - name: Code quality, linting, syntax, code style
49
- name: Build process
50
- name: Artifacts validation
51
- name: Artifacts validation on bare OS, stable to current lifecycle checks
@@ -97,22 +96,6 @@ jobs:
96
allow_failures:
97
- env: ALLOW_SOFT_FAILURE_HERE=true
98
include:
100
- # Do code quality, syntax checking and other pre-build activities
101
- - stage: Code quality, linting, syntax, code style
102
-
103
- name: Run shellchecking on BASH
104
- script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
105
-
106
- # This falls under same stage defined earlier
107
- - name: Run checksum checks on kickstart files
108
- script: ./tests/installer/checksums.sh
109
- env: LOCAL_ONLY="true"
110
-
111
- # This falls under same stage defined earlier
112
- - name: Web Dashboard pre-generated file consistency checks (dashboard.js)
113
- script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
114
-
115
-
99
# Ensure netdata code builds successfully
100
- stage: Build process
101
build/build.sh
deleted
-20
@@ -1,20 +0,0 @@
1
-#!/bin/bash
2
-
3
-if [ ! -f .gitignore ]; then
4
- echo "Run as ./travis/$(basename "$0") from top level directory of git repository"
5
- exit 1
6
-fi
7
-
8
-if [ "$IS_CONTAINER" != "" ]; then
9
- autoreconf -ivf
10
- ./configure --enable-maintainer-mode
11
- make dist
12
- rm -rf autom4te.cache
13
-else
14
- docker run --rm -it \
15
- --env IS_CONTAINER=TRUE \
16
- --volume "${PWD}:/project:Z" \
17
- --workdir "/project" \
18
- netdata/builder:gcc \
19
- ./build/build.sh
20
-fi