-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (50 loc) · 1.81 KB
/
validate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Workflow to check files for XML syntax and other lint checks
#
# This also does a dry run of updating formats.json, printing the diff but not committing changes.
# Based on the Python workflow template:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Validate XML files
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install lxml pre-commit
- name: Run lint checks
run: |
pre-commit run --all-files
- name: Validate XML files against schema
run: |
python scripts/validate_xml_schema.py
- name: Validate version numbers (pull request)
if: github.event_name == 'pull_request'
run: |
python scripts/check_version_bump.py --base-ref=${{ github.event.pull_request.base.sha }}
- name: Validate version numbers (push)
if: github.event_name == 'push' && !github.event.forced && github.event.before != '0000000000000000000000000000000000000000'
run: |
python scripts/check_version_bump.py --base-ref=${{ github.event.before }}
- name: Check for wrongly located files
run: |
python scripts/check_wrongly_located_files.py
# diff exits with 1 if differences, 2 if trouble; "|| [ $? -eq 1 ]" gets it to treat 1 as success
- name: Dry run of updating formats.json
run: |
python scripts/update_list.py -O v1/formats-updated.json
diff -s v1/formats.json v1/formats-updated.json || [ $? -eq 1 ]