From 93289c7c094c8076d30804f20ffeeed4a1f9f5ec Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Sat, 24 Apr 2021 09:28:40 +0200 Subject: [PATCH 1/3] CI: Move CI code into a single script --- .travis.yml | 8 +------- ci/run_shellcheck.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100755 ci/run_shellcheck.sh diff --git a/.travis.yml b/.travis.yml index 1194247..27cee52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,4 @@ cache: directories: - "/opt/shellcheck" script: -- mkdir -p /opt/shellcheck -- "[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz - | tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck - > /dev/null || true" -- sudo chmod +x /opt/shellcheck/shellcheck -- "/opt/shellcheck/shellcheck --version" -- "/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .)" +- ci/run_shellcheck diff --git a/ci/run_shellcheck.sh b/ci/run_shellcheck.sh new file mode 100755 index 0000000..0b32cbc --- /dev/null +++ b/ci/run_shellcheck.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -o pipefail +set -o errexit +set -o nounset +set -o errtrace +shopt -s inherit_errexit + +ci/run_shellcheck mkdir -p /opt/shellcheck +[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz + | tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck + > /dev/null || true +sudo chmod +x /opt/shellcheck/shellcheck +/opt/shellcheck/shellcheck --version +/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .) From 45def315942bd51c148e20035c601dd1253cd53c Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Sat, 24 Apr 2021 09:30:46 +0200 Subject: [PATCH 2/3] Improvements to CI script --- ci/run_shellcheck.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ci/run_shellcheck.sh b/ci/run_shellcheck.sh index 0b32cbc..cab0bca 100755 --- a/ci/run_shellcheck.sh +++ b/ci/run_shellcheck.sh @@ -6,10 +6,16 @@ set -o nounset set -o errtrace shopt -s inherit_errexit -ci/run_shellcheck mkdir -p /opt/shellcheck -[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz - | tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck - > /dev/null || true -sudo chmod +x /opt/shellcheck/shellcheck +if [[ ! -e /opt/shellcheck/shellcheck ]]; then + mkdir -p /opt/shellcheck + + wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz \ + | tar xJv -O shellcheck-stable/shellcheck \ + > /opt/shellcheck/shellcheck + + chmod +x /opt/shellcheck/shellcheck +fi + /opt/shellcheck/shellcheck --version -/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .) + +grep -lZP '^#!/bin/\w+sh' -R | xargs -0 /opt/shellcheck/shellcheck From 7456660ae42faf84331481264d049ca9f1bfe101 Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Sat, 24 Apr 2021 09:38:43 +0200 Subject: [PATCH 3/3] Replace Travis with GitHub actions --- .github/workflows/ci.yml | 11 +++++++++++ .travis.yml | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e19289c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,11 @@ +name: CI + +on: pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run shellcheck + run: ci/run_shellcheck.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27cee52..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -dist: bionic -language: bash -cache: - directories: - - "/opt/shellcheck" -script: -- ci/run_shellcheck