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

131 lines
4.3 KiB
YAML
Raw Permalink Normal View History

2023-11-22 22:32:01 +00:00
name: push
2023-11-20 21:08:07 +00:00
on:
push:
2023-11-22 22:49:55 +00:00
branches-ignore:
- 'main'
2023-11-22 22:51:13 +00:00
pull_request_target:
branches-ignore:
- 'main'
2023-11-20 21:08:07 +00:00
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'
2023-11-23 00:27:31 +00:00
- id: get_head_commit_title
run: echo "title=$(git log --format=%B -n 1 HEAD | head -n 1)" >> $GITHUB_OUTPUT
2023-11-20 21:08:07 +00:00
- 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
2023-11-22 18:37:19 +00:00
- uses: https://sigyl.com:3001/actions/ft-view-screen-document@main
2023-11-22 18:29:13 +00:00
name: document ft-view
with:
display-exclude-file: BatchImport_zone10_hmi_restored.xml
global-exclude-file: BatchImport_Global_zone10_hmi_restored.xml
display-folder: displays
global-folder: global objects
folder: ft-view-screens
2023-11-20 21:08:07 +00:00
- uses: https://sigyl.com:3001/actions/document-phases@main
2023-11-22 18:29:13 +00:00
name: document batch
2023-11-20 21:08:07 +00:00
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
2023-11-23 00:27:31 +00:00
git commit -a -m "documented ${{ steps.get-commit-title.outputs.text }}"
2023-11-20 21:08:07 +00:00
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