devilbox/.github/workflows/lint.yml

106 lines
2.8 KiB
YAML
Raw Normal View History

2019-11-21 08:43:00 +00:00
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: Lint
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Runs on Pull Requests
pull_request:
# Runs on master Branch and Tags
push:
branches:
- master
tags:
# -------------------------------------------------------------------------------------------------
# What to run
# -------------------------------------------------------------------------------------------------
jobs:
lint:
runs-on: ubuntu-latest
2020-12-12 18:13:31 +00:00
name: "[Lint]"
2019-11-21 08:43:00 +00:00
steps:
# ------------------------------------------------------------
# Checkout repository
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v1
- name: Lint
shell: bash
run: |
2020-12-12 18:13:31 +00:00
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
echo "[SUCC] ${n}/${RETRIES}";
return 0;
fi;
sleep ${PAUSE};
echo "[FAIL] ${n}/${RETRIES}";
done;
return 1;
}
2019-11-21 08:43:00 +00:00
cd .tests/
2020-12-12 18:13:31 +00:00
retry make lint-tests
env:
RETRIES: 20
PAUSE: 10
2020-12-12 16:39:21 +00:00
- name: Update Readme
shell: bash
run: |
2020-12-12 18:13:31 +00:00
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
echo "[SUCC] ${n}/${RETRIES}";
return 0;
fi;
sleep ${PAUSE};
echo "[FAIL] ${n}/${RETRIES}";
done;
return 1;
}
2020-12-12 16:39:21 +00:00
cd .tests/
2020-12-12 18:13:31 +00:00
retry make update-readme
2020-12-12 16:39:21 +00:00
git diff --quiet || { echo "Build Changes"; git diff; git status; false; };
2020-12-12 18:13:31 +00:00
env:
RETRIES: 20
PAUSE: 10
2020-12-12 16:39:21 +00:00
- name: Check configuration
shell: bash
run: |
2020-12-12 18:13:31 +00:00
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
echo "[SUCC] ${n}/${RETRIES}";
return 0;
fi;
sleep ${PAUSE};
echo "[FAIL] ${n}/${RETRIES}";
done;
return 1;
}
cp env-example .env
2020-11-12 16:11:14 +00:00
sed -i'' "s/^NEW_UID=.*/NEW_UID=$(id -u)/g" .env
sed -i'' "s/^NEW_GID=.*/NEW_GID=$(id -g)/g" .env
2020-12-12 18:13:31 +00:00
retry ./check-config.sh
env:
RETRIES: 20
PAUSE: 10