This commit is contained in:
1 parent
14cb687f7d
commit
9c1209eac0
2 files changed
+42
-28
No files matched your search
@@ -12,52 +12,63 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
quality-gate:
|
quality-gate:
|
||||||
name: Quality Gate
|
name: Quality Gate
|
||||||
runs-on: ubuntu-latest
|
runs-on: archlinux-x86_64
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
env:
|
env:
|
||||||
GODOT_VERSION: 4.7.2
|
GODOT_VERSION: 4.7.2
|
||||||
GODOT_BIN: /tmp/godot-4.7.2/Godot_v4.7.2-stable_linux.x86_64
|
|
||||||
GODOT_SHA512: 9aa00f7a605200940bce3027a567b782f49bd8e940dd06ae9e987bd65aee1b1467edd56ed84fcdcbdd44354bf613bdb4e5d2913e925850368e150c59ed54c65
|
GODOT_SHA512: 9aa00f7a605200940bce3027a567b782f49bd8e940dd06ae9e987bd65aee1b1467edd56ed84fcdcbdd44354bf613bdb4e5d2913e925850368e150c59ed54c65
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Check host dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
if command -v sudo >/dev/null 2>&1; then
|
missing_commands=()
|
||||||
sudo apt-get update
|
for required_command in bash curl git node rg sha512sum unzip; do
|
||||||
sudo apt-get install -y --no-install-recommends \
|
if ! command -v "$required_command" >/dev/null 2>&1; then
|
||||||
ca-certificates curl ripgrep unzip
|
missing_commands+=("$required_command")
|
||||||
else
|
fi
|
||||||
apt-get update
|
done
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
ca-certificates curl ripgrep unzip
|
if (( ${#missing_commands[@]} > 0 )); then
|
||||||
|
printf 'Missing commands on the Arch Linux runner: %s\n' \
|
||||||
|
"${missing_commands[*]}" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Install Godot 4.7.2
|
- name: Prepare Godot 4.7.2
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
archive="Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip"
|
archive="Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip"
|
||||||
release_url="https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable"
|
release_url="https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable"
|
||||||
download_directory="$(mktemp -d)"
|
install_directory="${XDG_CACHE_HOME:-$HOME/.cache}/ransoms-wake/godot-${GODOT_VERSION}"
|
||||||
install_directory="$(dirname "$GODOT_BIN")"
|
godot_bin="$install_directory/Godot_v${GODOT_VERSION}-stable_linux.x86_64"
|
||||||
|
|
||||||
curl --fail --location --silent --show-error \
|
if [[ ! -x "$godot_bin" ]]; then
|
||||||
"$release_url/$archive" \
|
download_directory="$(mktemp -d)"
|
||||||
--output "$download_directory/$archive"
|
trap 'rm -rf "$download_directory"' EXIT
|
||||||
printf '%s %s\n' \
|
|
||||||
"$GODOT_SHA512" "$download_directory/$archive" \
|
|
||||||
| sha512sum --check
|
|
||||||
|
|
||||||
mkdir -p "$install_directory"
|
curl --fail --location --silent --show-error \
|
||||||
unzip -q "$download_directory/$archive" -d "$install_directory"
|
"$release_url/$archive" \
|
||||||
chmod +x "$GODOT_BIN"
|
--output "$download_directory/$archive"
|
||||||
"$GODOT_BIN" --version
|
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
|
- name: Run the repository quality gate
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash scripts/quality_gate.sh
|
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
|
||||||
@@ -107,9 +107,12 @@ puis exécute les tests unitaires et d'intégration.
|
|||||||
|
|
||||||
Le workflow Gitea Actions `.gitea/workflows/quality-gate.yml` exécute cette
|
Le workflow Gitea Actions `.gitea/workflows/quality-gate.yml` exécute cette
|
||||||
même commande sur chaque push vers `main`, chaque pull request visant `main` et
|
même commande sur chaque push vers `main`, chaque pull request visant `main` et
|
||||||
à la demande. Il requiert un runner portant le label `ubuntu-latest`. Après sa
|
à la demande. Il requiert un runner natif portant le label
|
||||||
première exécution réussie, le contrôle `Quality Gate` doit être rendu
|
`archlinux-x86_64:host`, avec `bash`, `curl`, `git`, `node`, `rg`, `sha512sum` et
|
||||||
obligatoire dans la protection de la branche `main`.
|
`unzip` installés. Godot 4.7.2 est vérifié puis conservé dans le cache du compte
|
||||||
|
runner afin d'éviter un téléchargement à chaque exécution. Après sa première
|
||||||
|
exécution réussie, le contrôle `Quality Gate` doit être rendu obligatoire dans
|
||||||
|
la protection de la branche `main`.
|
||||||
|
|
||||||
Commandes individuelles pour diagnostic :
|
Commandes individuelles pour diagnostic :
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user