-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI and switch to documentation tables based on xcore
- CI runs on push/pull_request to branches as defined in #435 - Generation of documentation tables is now based on xcore - Documentation tables are generated for all those branches and uploaded to according subdirectories in GitHub pages - Documentation tables are no longer stored in the repository itself
- Loading branch information
1 parent
e43697a
commit 8a04b3e
Showing
47 changed files
with
7,290 additions
and
4,380 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,48 +1,84 @@ | ||
name: CI | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the "master" branch | ||
# Triggers the workflow on push and pull request events for specific branches | ||
push: | ||
branches: [ "master", "main", "changes_for_v*" ] | ||
branches: | ||
- main | ||
- develop | ||
- 'release/**' | ||
- 'feature/**' | ||
- 'bugfix/**' | ||
pull_request: | ||
branches: [ "master", "main", "changes_for_v*" ] | ||
branches: | ||
- main | ||
- develop | ||
- 'release/**' | ||
- 'feature/**' | ||
- 'bugfix/**' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
# required to upload to GitHub pages | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
run: | ||
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: echo "Job was automatically triggered by a ${{ github.event_name }} event for branch ${{ github.ref }}" | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Check out repository code for push | ||
if: github.event_name == 'push' # only if this is a push to a branch | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check out repository code for pull_request | ||
if: github.event_name == 'pull_request' # only if this is a pull_request to a branch | ||
uses: actions/checkout@v4 | ||
with: | ||
# https://github.com/marketplace/actions/add-commit#working-with-prs | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Install xmllint and xsltproc | ||
- name: Install java, xmllint and xsltproc | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libxml2-utils xsltproc | ||
sudo apt-get install default-jre libxml2-utils xsltproc | ||
- name: Validate structure and lint XSD and XML files | ||
run: ./.github/scripts/validate-and-lint.sh | ||
|
||
- name: Validate OJP XML examples | ||
run: ./.github/scripts/validate-examples.sh | ||
|
||
- name: Check schema structure for generation for documentation tables | ||
run: ./docs/validate-schema-conventions.sh | ||
|
||
- name: Generate documentation tables | ||
run: ./docs/generate-tables.sh | ||
|
||
- name: Get branch name | ||
id: get-branch-name | ||
# Done as an extra step because ${{ github.ref }} has "refs/heads/" prepended and there is no operation on GitHub strings possible | ||
# https://github.com/orgs/community/discussions/26625 | ||
if: github.event_name == 'push' # only if this is a push to a branch | ||
# cut -d/ -f3,4 splits the ${{ github.ref }} using "/" and returns 3rd and optional 4th position | ||
run: | | ||
BRANCH_NAME=$(echo ${{ github.ref }} | cut -d/ -f3,4) | ||
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT | ||
- name: Upload generated documentation tables | ||
if: github.event_name == 'push' # only if this is a push to a branch | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: './docs/generated' | ||
target-folder: "${{steps.get-branch-name.outputs.BRANCH_NAME}}" | ||
|
||
- name: Remove generated documentation tables | ||
run: rm -rf ./docs/generated/documentation-tables | ||
|
||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v9 # https://github.com/marketplace/actions/add-commit | ||
with: | ||
default_author: github_actions | ||
message: 'Lint and update documentation tables' | ||
message: 'fixup! Fixed linting errors' | ||
push: --set-upstream origin "${{steps.get-branch-name.outputs.BRANCH_NAME}}" |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.