Skip to content

Commit 64bdb9a

Browse files
committed
for xsf#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, leaving a comment that describes the validation result.
1 parent 7eaa396 commit 64bdb9a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/xep-validation.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: XEP validation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
name: Test changed-files
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Detect changes to XEP files.
18+
id: changed-xeps
19+
uses: tj-actions/changed-files@v34
20+
with:
21+
files: |
22+
xep-*.xml
23+
24+
- name: Run step if any file(s) in the docs folder change.
25+
id: validation
26+
if: steps.changed-files-specific.outputs.any_changed == 'true'
27+
run: |
28+
result=Success
29+
for xep in "${{ steps.changed-xeps.outputs.all_changed_files }}"; do
30+
if ! tools/validate-xep0001-conformance.sh "$xep"; then
31+
result=Failure
32+
echo "validate_$xep=success" >> $GITHUB_OUTPUT
33+
else
34+
echo "validate_$xep=failure" >> $GITHUB_OUTPUT
35+
fi
36+
done
37+
echo "result=$result" >> $GITHUB_OUTPUT
38+
39+
- uses: mshick/add-pr-comment@v2
40+
if: steps.changed-files-specific.outputs.any_changed == 'true'
41+
with:
42+
issue: ${{ steps.validation.outputs.result }}
43+
message: |
44+
Automated XEP validation result: ${{ steps.validation.outputs.result }}

0 commit comments

Comments
 (0)