Skip to content

Commit

Permalink
add ParlaMint Sample root file generation to github actions #226
Browse files Browse the repository at this point in the history
  • Loading branch information
matyaskopp committed Mar 8, 2024
1 parent 9dd3b4a commit 5ffe039
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/ParlaMintSample2root/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Update ParlaMint Sample root files'
#description: ''
inputs:
runs:
using: "composite"
steps:
- name: Root
run: |
cd $GITHUB_WORKSPACE/ParlaMint
for t_i in TEI_ TEI.ana_.ana en.TEI.ana_-en.ana; do
type=${t_i%_*};
interfix=${t_i#*_};
$s base=../Samples type=$type isSample=1 -xsl:Scripts/parlamint2root.xsl Scripts/ParlaMint-rootTemplate.xml \
> Samples/ParlaMint$interfix.xml ;
done
git status
git diff --quiet || git commit -m "action: generating ParlaMint roots for Sample folder #${{github.event.number}}" Samples/ParlaMint*.xml
git push
shell: bash


26 changes: 26 additions & 0 deletions .github/workflows/ParlaMintSample2root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ParlaMintSample2root

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Changes:
runs-on: ubuntu-latest
outputs:
parla_process: '${{ steps.detect-changes.outputs.parla_process }}'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout ParlaMint
uses: actions/checkout@v3
with:
path: ParlaMint
fetch-depth: 2 # when called a pull_request - test is run on test merge -> full history is not needed to detect changes
- name: Setup
uses: ./ParlaMint/.github/actions/ParlaMintEnvSetup
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
- name: Commit new sample root
uses: ./ParlaMint/.github/actions/ParlaMintSample2root
3 changes: 3 additions & 0 deletions .github/workflows/createSample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@ jobs:
git status
git commit -a -m "action: generating ParlaMint-${{needs.Changes.outputs.parla_changed}} sample files with #${{github.event.number}}"
git push
- name: Commit new sample root
if: ${{ success() }}
uses: ./ParlaMint/.github/actions/ParlaMintSample2root

0 comments on commit 5ffe039

Please sign in to comment.