@@ -2,25 +2,30 @@ name: Pull request checks
22
33on :
44 pull_request :
5- workflow_dispatch :
5+ branches :
6+ - main
67
78jobs :
89 check-unique-standard-names :
10+ name : Check for duplicates in standard names
911 runs-on : ubuntu-latest
1012 steps :
11- - uses : actions/checkout@v4
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
1215
13- - uses : actions/setup-python@v4
16+ - name : Setup Python
17+ uses : actions/setup-python@v4
1418 with :
1519 python-version : " 3.x"
1620
17- - name : Install xmllint
21+ - name : Install dependencies
1822 run : |
19- sudo apt-get update
20- sudo apt-get -y install libxml2-utils
23+ sudo apt-get update
24+ sudo apt-get -y install libxml2-utils
2125
2226 - name : Check for duplicate standard names
23- run : tools/check_xml_unique.py standard_names.xml
27+ run : |
28+ tools/check_xml_unique.py standard_names.xml
2429
2530 check-name-rules :
2631 name : Check standard names against rules
@@ -30,42 +35,49 @@ jobs:
3035 - name : Checkout repository
3136 uses : actions/checkout@v4
3237
33- - uses : actions/setup-python@v4
38+ - name : Setup Python
39+ uses : actions/setup-python@v4
3440 with :
3541 python-version : " 3.x"
3642
37- # Install dependencies
3843 - name : Install dependencies
3944 run : |
4045 sudo apt-get update
4146 sudo apt-get -y install libxml2-utils
4247
43-
4448 - name : Checks standard names against character rules
4549 run : |
4650 python3 tools/check_name_rules.py -s standard_names.xml
4751
48- check-rerendered-markdown :
52+ test-rendering :
53+ name : Test rendering xml file to markdown and yaml
4954 runs-on : ubuntu-latest
5055 steps :
51- - uses : actions/checkout@v4
56+ - name : Checkout repository
57+ uses : actions/checkout@v4
5258
53- - uses : actions/setup-python@v4
59+ - name : Setup Python
60+ uses : actions/setup-python@v4
5461 with :
5562 python-version : " 3.x"
5663
57- - name : Install xmllint
64+ - name : Install dependencies
5865 run : |
59- sudo apt-get update
60- sudo apt-get -y install libxml2-utils
66+ sudo apt-get update
67+ sudo apt-get -y install libxml2-utils
68+ python -m pip install --upgrade pip
69+ python -m pip install PyYaml
6170
62- - name : Check markdown has been rerendered
71+ - name : Test rendering xml file to markdown
6372 run : |
64- # Checks if the saved markdown matches freshly rendered markdown.
65- # If this fails you have likely forgotten to rerun the write script
66- # after adding a new name, or updating its description.
67- checksum=$(sha256sum Metadata-standard-names.md)
68- tools/write_standard_name_table.py standard_names.xml
69- test "$checksum" = "$(sha256sum Metadata-standard-names.md)"
70-
73+ tools/write_standard_name_table.py --output-format md standard_names.xml
74+ echo "The following changes will be committed when this pull request is merged (git diff Metadata-standard-names.md; "
75+ echo "assuming that 'Metadata-standard-names.md' wasn't updated and matches the version in the authoritative branch):"
76+ git diff Metadata-standard-names.md
7177
78+ - name : Test rendering xml file to yaml
79+ run : |
80+ tools/write_standard_name_table.py --output-format yaml standard_names.xml
81+ echo "The following changes will be committed when this pull request is merged (git diff Metadata-standard-names.yaml; "
82+ echo "assuming that 'Metadata-standard-names.yaml' wasn't updated and matches the version in the authoritative branch):"
83+ git diff Metadata-standard-names.yaml
0 commit comments