From 7fe85067fa4ae4749e48fd2b7200ccbf1c650711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 26 Feb 2020 17:54:14 +0100 Subject: [PATCH] added github action (#135) --- .github/lint-scripts.sh | 23 +++++++++++++++++++++++ .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 .github/lint-scripts.sh create mode 100644 .github/workflows/ci.yaml diff --git a/.github/lint-scripts.sh b/.github/lint-scripts.sh new file mode 100755 index 0000000..194b74d --- /dev/null +++ b/.github/lint-scripts.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# lint bash scripts +# + +set -o errexit + +CONFIG_DIR=".github" +HOOKS_DIR="hooks" +CONTAINER_DIR="containers" + +TMP_FILE="$(mktemp)" + +find "${CONFIG_DIR}" -type f -name "*.sh" > "${TMP_FILE}" +find "${HOOKS_DIR}" -type f -name "*.sh" >> "${TMP_FILE}" +find "${CONTAINER_DIR}" -type f -name "*.sh" >> "${TMP_FILE}" + +while read -r FILE; do + echo lint "${FILE}" + shellcheck -x "${FILE}" +done < "${TMP_FILE}" + +rm "${TMP_FILE}" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2ea4e55 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,27 @@ +name: ci + +on: + pull_request: + +jobs: + lint-bash-scripts: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Lint Bash scripts + uses: docker://koalaman/shellcheck-alpine:v0.7.0 + with: + args: .github/lint-scripts.sh + + install-docker-compose: + name: install-docker-compose + runs-on: ubuntu-latest + needs: lint-bash-scripts + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: get containers + run: docker-compose pull + - name: install + run: docker-compose up