Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow to check for missing keyword linking #478

Merged
merged 14 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/check_keyword_linking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Check for missing keyword linking

# NOTE: Added "push" here such that PR authors can test the actions in their forked repository
# before submitting a PR.
# NOTE: It is not possible to avoid the duplication of the paths in the "push" and
# "pull_request" sections. This is a known limitation of the GitHub Actions syntax.
on:
push:
paths:
- 'parts/**/*.fodt'
pull_request:
paths:
- 'parts/**/*.fodt'

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.4" # The "latest" version is not working
- name: Install dependencies
run: |
cd scripts/python
poetry install
- name: Run checks
run: |
cd scripts/python
# The following command will fail if there are any changes to the kw_uri_map.txt file
# If it fails, the whole workflow fails and the PR should not be merged. The user should
# then run 'poetry run fodt-gen-kw-uri-map' to update the kw_uri_map.txt file and commit
# the changes the current PR and push them to the remote repository the workflow should
# then pass on the next run.
poetry run fodt-gen-kw-uri-map --check-changed

# The following command will fail if there are any changes to the keyword linking in the
# .fodt files. If it fails, the whole workflow fails and the PR should not be merged. The
# user should then run fodt-link-keywords script to update the keyword linking in the files
# and commit the changes the current PR and push them to the remote repository the workflow
# should then pass on the next run.
# TODO: We disable this check until links have been updated in the chapters, and the
# we can expect the check to pass.
#poetry run fodt-link-keywords --all --check-changed
2 changes: 1 addition & 1 deletion parts/appendices/F.fodt
Original file line number Diff line number Diff line change
Expand Up @@ -45781,7 +45781,7 @@ Updated with AFR/TSA Rev-D comments and new keywords.</dc:description><meta:init
<text:p text:style-name="P1351">Keywords</text:p>
</table:table-cell>
<table:table-cell table:style-name="Table883.F27" office:value-type="string">
<text:p text:style-name="_40_Table_20_Contents">PRESSURE</text:p>
<text:p text:style-name="_40_Table_20_Contents"><text:a xlink:href="#__RefHeading___Toc135627_1317547213">PRESSURE</text:a></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table883.G27" table:number-rows-spanned="3" office:value-type="string">
<text:p text:style-name="_40_Table_20_Contents"><text:a xlink:type="simple" xlink:href="#__RefHeading___Toc55049_4106839650" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">LGR</text:a> solution array section. </text:p>
Expand Down
Loading
Loading