Skip to content

Add workflow for automated test-suite update #106

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 1 commit into from
May 4, 2024
Merged
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
55 changes: 55 additions & 0 deletions .github/workflows/check-test-suite-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Checks JSON schema test suite for updates

on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'

jobs:
check-updates:
runs-on: ubuntu-latest
env:
SUITE_PATH: test-suites/schema-test-suite
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_PAT }}
submodules: true
- name: Pull latest changes from JSON schema test suite
run: git submodule update --remote
- name: Check for updates
id: updates
run: |
DIFF=$(git diff)
HAS_UPDATES=false
if [[ "$DIFF" != "" ]]; then
HAS_UPDATES=true
else
echo "No updates"
fi
echo "has-updates=$HAS_UPDATES" >> $GITHUB_OUTPUT
cd ${SUITE_PATH}
SUITE_SHA=$(git rev-parse --short HEAD)
echo "branch=suite-${SUITE_SHA}"
- name: Commit changes to new branch
if: steps.updates.outputs.has-updates == 'true'
uses: EndBug/add-and-commit@v9
with:
add: "['${{ env.SUITE_PATH }}']"
default_author: github_actions
message: "Update JSON schema test-suite"
new_branch: ${{ steps.updates.outputs.branch }}
- name: Create PR for version update
if: steps.updates.outputs.has-updates == 'true'
env:
GH_TOKEN: ${{ secrets.PUSH_PAT }}
run: >
gh pr create --title "Update JSON schema test-suite"
--body "Automated update"
--head ${{ steps.updates.outputs.branch }}
--base main
--reviewer OptimumCode
--label ignore
--label tests

Loading