summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2022-04-12 21:37:38 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2022-04-12 21:37:38 +0300
commit0980709210144ef8c5ee9d39987aa15906b7dcdb (patch)
treed61ebbceb0283c772f6c6cccaf8c8136e7d1e738 /.github
parentuid-gid.txt: add uid/gid for games-simulation/openttd (diff)
downloadapi-0980709210144ef8c5ee9d39987aa15906b7dcdb.tar.gz
api-0980709210144ef8c5ee9d39987aa15906b7dcdb.tar.bz2
api-0980709210144ef8c5ee9d39987aa15906b7dcdb.zip
Add CI workflow for checking repositories.xml
For pull requests touching repositories.xml, check that added emails are associated with a bugzilla account, it matches schema, it is sorted, and some must have fields are defined. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/repositories.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/repositories.yml b/.github/workflows/repositories.yml
new file mode 100644
index 0000000..3c3a0c3
--- /dev/null
+++ b/.github/workflows/repositories.yml
@@ -0,0 +1,46 @@
+name: repositories
+on:
+ pull_request:
+ paths:
+ - 'files/overlays/repositories.xml'
+
+jobs:
+ validate-content:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - uses: actions/setup-python@v3
+ with:
+ python-version: '3.x'
+ cache: 'pip'
+ - name: Install pip dependencies
+ run: pip install lxml
+
+ - name: Check repositories.xml
+ run: |
+ BASE_REF=$(git merge-base --fork-point origin/${{ github.base_ref }})
+ python bin/repositories-checker.py <(git show ${BASE_REF}:files/overlays/repositories.xml) files/overlays/repositories.xml
+
+ validate-schema:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Download repositories.xml schema
+ run: wget https://gitweb.gentoo.org/data/xml-schema.git/plain/repositories.xsd
+
+ - name: Prepare xmllint annotator
+ uses: korelstar/xmllint-problem-matcher@v1
+
+ - name: Lint repositories.xml
+ uses: ChristophWurst/xmllint-action@v1
+ with:
+ xml-file: ./files/overlays/repositories.xml
+ xml-schema-file: ./repositories.xsd