75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
name: Quality Gate
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
quality-gate:
|
|
name: Quality Gate
|
|
runs-on: deploy-production
|
|
timeout-minutes: 15
|
|
env:
|
|
GODOT_VERSION: 4.7.2
|
|
GODOT_SHA512: 9aa00f7a605200940bce3027a567b782f49bd8e940dd06ae9e987bd65aee1b1467edd56ed84fcdcbdd44354bf613bdb4e5d2913e925850368e150c59ed54c65
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check host dependencies
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
missing_commands=()
|
|
for required_command in bash curl git node rg sha512sum unzip; do
|
|
if ! command -v "$required_command" >/dev/null 2>&1; then
|
|
missing_commands+=("$required_command")
|
|
fi
|
|
done
|
|
|
|
if (( ${#missing_commands[@]} > 0 )); then
|
|
printf 'Missing commands on the Arch Linux runner: %s\n' \
|
|
"${missing_commands[*]}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
- name: Prepare Godot 4.7.2
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
archive="Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip"
|
|
release_url="https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable"
|
|
install_directory="${XDG_CACHE_HOME:-$HOME/.cache}/ransoms-wake/godot-${GODOT_VERSION}"
|
|
godot_bin="$install_directory/Godot_v${GODOT_VERSION}-stable_linux.x86_64"
|
|
|
|
if [[ ! -x "$godot_bin" ]]; then
|
|
download_directory="$(mktemp -d)"
|
|
trap 'rm -rf "$download_directory"' EXIT
|
|
|
|
curl --fail --location --silent --show-error \
|
|
"$release_url/$archive" \
|
|
--output "$download_directory/$archive"
|
|
printf '%s %s\n' \
|
|
"$GODOT_SHA512" "$download_directory/$archive" \
|
|
| sha512sum --check
|
|
|
|
mkdir -p "$install_directory"
|
|
unzip -q "$download_directory/$archive" -d "$install_directory"
|
|
chmod +x "$godot_bin"
|
|
fi
|
|
|
|
"$godot_bin" --version
|
|
|
|
- name: Run the repository quality gate
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
export GODOT_BIN="${XDG_CACHE_HOME:-$HOME/.cache}/ransoms-wake/godot-${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_linux.x86_64"
|
|
bash scripts/quality_gate.sh
|