mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-18 20:37:55 +00:00
105 lines
2.8 KiB
YAML
105 lines
2.8 KiB
YAML
---
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
|
# Job Name
|
|
# -------------------------------------------------------------------------------------------------
|
|
name: Lint
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
|
# When to run
|
|
# -------------------------------------------------------------------------------------------------
|
|
on:
|
|
# Runs on Pull Requests
|
|
pull_request:
|
|
|
|
# Runs on master Branch and Tags
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------------
|
|
# What to run
|
|
# -------------------------------------------------------------------------------------------------
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: "[Lint]"
|
|
steps:
|
|
|
|
# ------------------------------------------------------------
|
|
# Checkout repository
|
|
# ------------------------------------------------------------
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Lint
|
|
shell: bash
|
|
run: |
|
|
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;
|
|
}
|
|
|
|
cd .tests/
|
|
retry make lint-tests
|
|
env:
|
|
RETRIES: 20
|
|
PAUSE: 10
|
|
|
|
- name: Update Readme
|
|
shell: bash
|
|
run: |
|
|
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;
|
|
}
|
|
|
|
cd .tests/
|
|
retry make update-readme
|
|
git diff --quiet || { echo "Build Changes"; git diff; git status; false; };
|
|
env:
|
|
RETRIES: 20
|
|
PAUSE: 10
|
|
|
|
- name: Check configuration
|
|
shell: bash
|
|
run: |
|
|
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
|
|
sed -i'' "s/^NEW_UID=.*/NEW_UID=$(id -u)/g" .env
|
|
sed -i'' "s/^NEW_GID=.*/NEW_GID=$(id -g)/g" .env
|
|
retry ./check-config.sh
|
|
env:
|
|
RETRIES: 20
|
|
PAUSE: 10
|