Merge pull request #168 from saveriomiroddi/replace_travis_with_github_actions

Replace Travis with GitHub actions
This commit is contained in:
Saverio Miroddi 2021-04-24 09:44:42 +02:00 committed by GitHub
commit 6bdb11b6a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 14 deletions

11
.github/workflows/ci.yml vendored Normal file
View File

@ -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

View File

@ -1,14 +0,0 @@
---
dist: bionic
language: bash
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 .)"

21
ci/run_shellcheck.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -o pipefail
set -o errexit
set -o nounset
set -o errtrace
shopt -s inherit_errexit
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
grep -lZP '^#!/bin/\w+sh' -R | xargs -0 /opt/shellcheck/shellcheck