-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (96 loc) · 4.22 KB
/
ModelCheck.yml
File metadata and controls
116 lines (96 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (c) LieberLieber Software GmbH
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
name: LemonTree Model Readiness Check
on:
push:
env:
ModelName: DemoModel.eapx
jobs:
ModelReadinessCheck:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- name: Download LemonTree Check Tool
run: |
# Powershell sees curly brackets as codeblocks so use quotations marks "{}" or just write your guids without them
# while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest
# curl "https://nexus.lieberlieber.com/repository/lemontree-pipeline-tools/LemonTree.Pipeline.Tools.ModelCheck.exe" --output .\LemonTree.Pipeline.Tools.ModelCheck.exe -k
Invoke-WebRequest -URI "https://nexus.lieberlieber.com/repository/lemontree-pipeline-tools/LemonTree.Pipeline.Tools.ModelCheck.exe" -OutFile .\LemonTree.Pipeline.Tools.ModelCheck.exe
- name: Run LemonTree Check Tool
id: modelcheck
run: |
Write-Output "starting validation"
.\LemonTree.Pipeline.Tools.ModelCheck.exe --model "${{env.ModelName}}" --out ".\output.md" --FailOnErrors
Get-Content "output.md" >> $env:GITHUB_STEP_SUMMARY
# Exit codes of LemonTree.Pipeline.Tools.ModelCheck.exe:
# * -2 = other runtime exception occurred
# * -1 = CLI argument parsing error occurred
# * 0 = model is valid (no error, no warning, no runtime exception)
# * 1 = model has at least one warning (only if --FailOnWarnings or --FailOnErrors)
# * 2 = model has at least one error (only if --FailOnErrors)
# $Message = "output.md"
Write-Output "modelcheckExitCode=$LASTEXITCODE" >> $env:GITHUB_OUTPUT
Write-Output "finished validation with $LASTEXITCODE"
#for now never stop
exit 0
# - name: Extract branch name
# id: extract_branch
# run: |
# echo "branch=$env:GITHUB_HEAD_REF" >> $env:GITHUB_OUTPUT
# - name: Find Pull Request
# uses: juliangruber/find-pull-request-action@v1
# id: find-pull-request
# with:
# branch: ${{ steps.extract_branch.outputs.branch }}
# - name: Read output.md
# if: ${{ steps.find-pull-request.outputs.number > 0}} #only makes sense if we have a PR for the branch
# id: package
# uses: juliangruber/read-file-action@v1
# with:
# path: .\output.md
# - name: Create PR comment
# if: ${{ steps.find-pull-request.outputs.number > 0}} #only makes sense if we have a PR for the branch
# uses: actions/github-script@v6
# with:
# script: |
# await github.rest.issues.createComment({
# issue_number: ${{ steps.find-pull-request.outputs.number }},
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: `${{ steps.package.outputs.content }}`
# })
- name: evaulate Exit Code
run: |
Write-Output "set job failed on ..."
Write-Output "Current Exit Code ${{ steps.modelcheck.outputs.modelcheckExitCode }}"
if (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 1)
{
#fail on warning
Write-Output "model has at least one warning"
#fail on warning
#exit 3
#ignore warning
exit 0
}
elseif (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 2)
{
#fail on Error
Write-Output "model has at least one error"
exit 2
}
elseif (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 0)
{
#brilliant model
Write-Output "modelcheck is passed"
exit 0
}
else
{
exit steps.modelcheck.outputs.modelcheckExitCode
}