-
Notifications
You must be signed in to change notification settings - Fork 4
Validate the full standard examples corpus in CI #81
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Weekly update | ||
|
|
||
| # Bumps the pinned pals-project/pals commit | ||
| # (tests/standard_examples_git_reference.txt) that | ||
| # the standard_examples workflow validates against, as a PR. A change to the | ||
| # standard that breaks the examples validation therefore shows up in that PR, | ||
| # not in unrelated ones. | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 9 * * 1" # every Monday at 1:00am PST (9:00am UTC) | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| autoupdate: | ||
| name: Autoupdate | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v7 | ||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| - name: Checkout branch | ||
| run: | | ||
| git checkout weekly_update || git checkout -b weekly_update | ||
| - name: Update the pinned PALS standard commit | ||
| id: bump | ||
| run: | | ||
| old=$(grep -vE '^[[:space:]]*(#|$)' tests/standard_examples_git_reference.txt | head -n1) | ||
| new=$(git ls-remote https://github.com/pals-project/pals.git refs/heads/main | cut -f1) | ||
| sed -i "s/^${old}\$/${new}/" tests/standard_examples_git_reference.txt | ||
| echo "old=${old}" >> "$GITHUB_OUTPUT" | ||
| echo "new=${new}" >> "$GITHUB_OUTPUT" | ||
| - name: Commit changes | ||
| id: commit | ||
| run: | | ||
| if git diff --quiet; then | ||
| echo "The pin already matches pals main; nothing to update." | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| git add -u | ||
| git commit -m "Update the pinned PALS standard commit" | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Push changes | ||
| if: steps.commit.outputs.changed == 'true' | ||
| run: | | ||
| git push -f origin weekly_update | ||
| - name: Open pull request | ||
| if: steps.commit.outputs.changed == 'true' | ||
| run: | | ||
| if [ -n "$(gh pr list --head weekly_update --state open --json number --jq '.[].number')" ]; then | ||
| echo "An open weekly_update PR already exists; the push updated it." | ||
| exit 0 | ||
| fi | ||
| gh pr create \ | ||
| --base main \ | ||
| --title "PALS standard: weekly update of the pinned commit" \ | ||
| --body "Bump the pinned pals-project/pals commit from \ | ||
| pals-project/pals@${{ steps.bump.outputs.old }} to \ | ||
| pals-project/pals@${{ steps.bump.outputs.new }} \ | ||
| (https://github.com/pals-project/pals/compare/${{ steps.bump.outputs.old }}...${{ steps.bump.outputs.new }}). | ||
|
|
||
| Automated via .github/workflows/weekly_update.yml." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # The commit of pals-project/pals that the standard_examples workflow checks | ||
| # out and validates the examples corpus from. Pinning a fixed commit keeps | ||
| # changes to the standard from breaking unrelated pals-python PRs; the | ||
| # weekly_update workflow bumps this pin to the current main in a PR of its | ||
| # own, so a breaking change in the standard surfaces there, reviewed and | ||
| # controlled. | ||
| # | ||
| # The first non-comment line is the pin: a full commit SHA of | ||
| # https://github.com/pals-project/pals | ||
| 5c39fde043ddad7a961ede01a5ad73d90b098aec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Standard example files pals-python cannot read yet, one path per line | ||
| # relative to the standard's examples directory. validate_standard_examples.py | ||
| # treats a failure of a listed file as expected and a listed file that starts | ||
| # to load as an error, so this list shrinks as support lands. Blank lines and | ||
| # `#` comments are ignored. | ||
|
|
||
| # PALSroot models only `version` and `facility`, and `facility` is required: | ||
| # additional attributes (notes, extension labels, or a version | ||
| # only) are rejected. | ||
| unit_tests/loading/basic/joiner.pals.yaml | ||
| unit_tests/loading/diamond/joiner.pals.yaml | ||
| unit_tests/loading/diamond/left.pals.yaml | ||
| unit_tests/loading/diamond/right.pals.yaml | ||
| unit_tests/loading/diamond/shared.pals.yaml | ||
| unit_tests/loading/extension_labels/a.pals.yaml | ||
| unit_tests/loading/extension_labels/joiner.pals.yaml | ||
| unit_tests/loading/implicit_self/a.pals.yaml | ||
| unit_tests/loading/implicit_self/joiner.pals.yaml | ||
| unit_tests/loading/nested/a.pals.yaml | ||
| unit_tests/loading/nested/inner.pals.yaml | ||
| unit_tests/loading/nested/joiner.pals.yaml | ||
| unit_tests/loading/relative_paths/joiner.pals.yaml | ||
| unit_tests/loading/relative_paths/sub/inner.pals.yaml | ||
| unit_tests/loading/relative_paths/top.pals.yaml | ||
| unit_tests/loading/self_position/a.pals.yaml | ||
| unit_tests/loading/self_position/b.pals.yaml | ||
| unit_tests/loading/self_position/joiner.pals.yaml | ||
| unit_tests/loading/version_match/a.pals.yaml | ||
| unit_tests/loading/version_match/joiner.pals.yaml | ||
|
|
||
| # An integer `version` (root_keys writes `version: 1`) is rejected; the model | ||
| # wants a string or null. | ||
| unit_tests/document/root_keys.pals.yaml | ||
|
|
||
| # `include` entries inside a facility are not resolved. | ||
| machine/machine.pals.yaml | ||
| unit_tests/loading/include/sub/layout.pals.yaml | ||
|
|
||
| # The sequence form of `variables` and the compact `sets` form are not | ||
| # modeled. | ||
| unit_tests/expressions/inline_expressions.pals.yaml | ||
| unit_tests/sets/sets_compact.pals.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this file maybe, now or in the future, a TOML format could be useful in case we want to add metadata to the failures, e.g.,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. But also our goal is that this file is empty when we are done :D
I hope we will not have to permanently exclude files