batch-example-2/.github/workflows/push.yml

116 lines
3.7 KiB
YAML

name: target
on:
push:
jobs:
format:
runs-on: ubuntu-latest
outputs:
formatted: ${{ steps.has-changes.outputs.changes }}
steps:
- uses: RouxAntoine/checkout@v3.5.4
with:
token: ${{ secrets.BOT_TOKEN }}
# fetch-depth: '1'
- uses: actions/setup-node@v3
with:
node-version: '20.9.0'
#- run: git checkout -b ${{ github.head_ref }}
#- run: git pull origin ${{ github.head_ref }}
- uses: sigyl-actions/xml-format@v0.0.2
with:
folder: '.'
regex: ^.+\.(([aA][xX][mM][lL]))$
- uses: sigyl-actions/ftbatch-strip-dates@v0.0.1
with:
folder: './recipes'
regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$
- uses: sigyl-actions/xml-format@v0.0.2
with:
folder: './recipes'
regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$
- uses: sigyl-actions/check-for-changes@v1.0.1
id: has-changes
- uses: sigyl-actions/git-prep@v1.0.0
if: steps.has-changes.outputs.changes == 'true'
- run: git status
- name: commit if changed
if: steps.has-changes.outputs.changes == 'true'
run: |
git add -A
git commit -a -m "formatted"
git push origin HEAD
exit 1
document:
needs: format
if: needs.format.outputs.formatted != 'true'
runs-on: ubuntu-latest
outputs:
formatted: ${{ steps.has-changes.outputs.changes }}
steps:
- uses: RouxAntoine/checkout@v3.5.4
with:
token: ${{ secrets.BOT_TOKEN }}
# fetch-depth: '1'
- uses: actions/setup-node@v3
with:
node-version: '20.9.0'
#- run: git checkout -b ${{ github.head_ref }}
#- run: git pull origin ${{ github.head_ref }}
- run: rm -rf document
- run: mkdir document
- uses: https://sigyl.com:3001/actions/document-phases@main
name: document
with:
document: document
model: equipment-model.axml
opc: equipment-model.json
recipes: recipes
- uses: sigyl-actions/check-for-changes@v1.0.1
id: has-changes
- uses: sigyl-actions/git-prep@v1.0.0
if: steps.has-changes.outputs.changes == 'true'
- run: git status
- name: commit if changed
if: steps.has-changes.outputs.changes == 'true'
run: |
git add -A
git commit -a -m "documented"
git push origin HEAD
exit 1
schema:
runs-on: ubuntu-latest
needs: document
if: needs.document.outputs.formatted != 'true'
outputs:
result: ${{ steps.schema.outputs.result }}
error: ${{ steps.schema.outputs.error }}
schema: ./.github/schemas/AreaModel.xsd
steps:
- uses: RouxAntoine/checkout@v3.5.4
with:
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: '1'
- uses: actions/setup-node@v3
with:
node-version: '20'
- id: pwd
run: |
echo -n pwd= >> $GITHUB_OUTPUT
pwd >> $GITHUB_OUTPUT
- uses: sigyl-actions/xml-schema@v0.0.1
id: schema
# continue-on-error: true
with:
schema_path: ${{ steps.pwd.outputs.pwd}}
folder: '.'
regex: ^.+\.(([aA][xX][mM][lL]))$
xsd: ./.github/schemas/AreaModel.xsd
# master recipes isn't a valid schema!
#- uses: sigyl-actions/xml-schema@main
# with:
# schema_path: ${{ steps.pwd.outputs.pwd}}
# folder: './recipes'
# regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$
# xsd: ./.github/schemas/MasterRecipe.xsd