From 4138d04186677998a1cfc042347d3faff5e36eaa Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 20:19:18 -0400 Subject: [PATCH] Fail CI if workflow needs regenerating. --- .github/workflows/pull-request.yml | 6 ++++-- etc/ci/workflow_changed.sh | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 etc/ci/workflow_changed.sh diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 44e386af935..7ac0ce74aa9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,11 +20,13 @@ jobs: python3 -m pip install --upgrade pip virtualenv sudo apt update python3 ./mach bootstrap - - name: Tidy - run: python3 ./mach test-tidy --no-progress --all + - name: Workflow check + run: ./etc/ci/workflow_changed.sh - name: Release build run: python3 ./mach build --release - name: Unit tests run: python3 ./mach test-unit --release + - name: Tidy + run: python3 ./mach test-tidy --no-progress --all - name: Lockfile check run: ./etc/ci/lockfile_changed.sh diff --git a/etc/ci/workflow_changed.sh b/etc/ci/workflow_changed.sh new file mode 100755 index 00000000000..c87775a7057 --- /dev/null +++ b/etc/ci/workflow_changed.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +set -o errexit +set -o nounset +set -o pipefail + +python3 etc/ci/generate_workflow.py + +diff="$(find . -name 'main.yml' -print0 | xargs -0 git diff)" +echo "${diff}" +[[ -z "${diff}" ]]