From 561363dabd11cafc0af574ea81db0a5019da6be6 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 15 Dec 2022 09:38:42 +0100 Subject: [PATCH] for #1240: Integrate XEP validation in CI Adds a Github workflow that executes `tools/validate-xep0001-conformance.sh` against any changed XEP that was changed in a pull request. --- .github/workflows/xep-validation.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/xep-validation.yml diff --git a/.github/workflows/xep-validation.yml b/.github/workflows/xep-validation.yml new file mode 100644 index 000000000..3e8a6cc50 --- /dev/null +++ b/.github/workflows/xep-validation.yml @@ -0,0 +1,36 @@ +name: XEP validation + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + name: Validate any XEP changes + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Detect changes to XEP files + id: changed-xeps + uses: tj-actions/changed-files@v34 + with: + files: | + xep-*.xml + inbox/* + + - name: Validate changed file(s) + id: validation + if: steps.changed-xeps.outputs.any_changed == 'true' + run: | + sudo apt-get install -y libxml2-utils + result=0 + for xep in "${{ steps.changed-xeps.outputs.all_changed_files }}"; do + if ! tools/validate-xep0001-conformance.sh "$xep"; then + result=1 + fi + done + exit $result