-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (137 loc) · 5.8 KB
/
github-actions-demo.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Testing examples with FMU Checker
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
nimversion:
- binary:stable
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: iffy/install-nim@v5
with:
nim-version: ${{ matrix.nimversion }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: goto-bus-stop/setup-zig@v2
#- run: zig build test
#- name: Test
# run: |
# nimble install -y
# nimble test
# - name: Setup MSYS2 (Windows)
# if: ${{matrix.target == 'windows'}}
# uses: msys2/setup-msys2@v2
# with:
# path-type: inherit
# update: true
# install: base-devel git mingw-w64-x86_64-toolchain
- name: Install FMU Compliance Checker (linux64)
uses: robinraju/[email protected]
if: runner.os == 'Linux'
with:
repository: "modelica-tools/FMUComplianceChecker"
tag: "2.0.4"
fileName: "FMUChecker-2.0.4-linux64.zip"
extract: true
- name: Install FMU Compliance Checker (win64)
uses: robinraju/[email protected]
if: runner.os == 'Windows'
with:
repository: "modelica-tools/FMUComplianceChecker"
tag: "2.0.4"
fileName: "FMUChecker-2.0.4-win64.zip"
extract: true
# chmod +x /home/runner/work/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64/fmuCheck.win64
- name: Make FMUChecker executable in Linux
run: chmod +x /home/runner/work/fmu.nim/fmu.nim/FMUChecker-2.0.4-linux64/fmuCheck.linux64
if: runner.os == 'Linux'
#run: |
# if [ "$RUNNER_OS" == "Linux" ]; then
# chmod +x /home/runner/work/fmu.nim/fmu.nim/FMUChecker-2.0.4-linux64/fmuCheck.linux64
# fi
#elif [ "$RUNNER_OS" == "Windows" ]; then
# chmod +x /home/runner/work/fmu.nim/fmu.nim/FMUChecker-2.0.4-linux64/fmuCheck.linux64
- name: Install fmu.nim
run: |
nimble install -y
- name: Create inc.fmu as Model exchange
run: |
cd examples/inc
nim c -r -d:fmu2me inc
- name: Execute FMU checker over inc.fmu in Linux
run: |
cd examples/inc
/home/runner/work/fmu.nim/fmu.nim/FMUChecker-2.0.4-linux64/fmuCheck.linux64 -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu
if: runner.os == 'Linux'
- name: Set path for windows (working)
shell: bash
run: |
echo "/d/a/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64" >> $GITHUB_PATH
echo "C:\msys64\usr\bin" >> $GITHUB_PATH
if: runner.os == 'Windows'
# - name: Execute FMU checker over inc.fmu in Windows
# shell: bash
# # echo "$PATH"
# run: |
# fmuCheck.win64.exe
# if: runner.os == 'Windows'
# - name: Execute FMU checker over inc.fmu in Windows (testing msys2)
# shell: msys2 {0}
# # echo "$PATH"
# run: |
# fmuCheck.win64.exe -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu
# if: runner.os == 'Windows'
#${{matrix.target == 'windows'}}
# - name: Execute FMU checker over inc.fmu in Windows [working]
# shell: bash
# # echo "$PATH"
# run: |
# /d/a/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64/fmuCheck.win64.exe
# if: runner.os == 'Windows'
# - name: Execute FMU checker over inc.fmu in Windows (Testing cmd - not working)
# shell: cmd
# run: D:/a/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64/fmuCheck.win64.exe -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu
# if: runner.os == 'Windows'
# D:/a/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64/
# - name: Execute FMU checker over inc.fmu in Windows (Testing PowerShell)
# run: |
# & fmuCheck.win64.exe -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu
# if: runner.os == 'Windows'
- name: Execute FMU checker over inc.fmu in Windows (Testing bash)
shell: bash
run: fmuCheck.win64.exe -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu
if: runner.os == 'Windows'
# - name: Execute FMU checker over inc.fmu in Windows
# shell: bash
# run: |
# chmod +x /d/a/fmu.nim/fmu.nim/FMUChecker-2.0.4-win64/fmuCheck.win64.exe
# ls examples/inc
# fmuCheck.win64.exe
# "fmuCheck.win64.exe -h 1 -s 14 -f -l 6 -e inc.log -o inc.csv inc.fmu"
# if: runner.os == 'Windows'
# https://github.com/marketplace/actions/smart-diff
- name: Compare the result file
uses: GuillaumeFalourd/diff-action@v1
with:
first_file_path: examples/inc/inc_me.csv
second_file_path: examples/inc/inc.csv
expected_result: PASSED
#- name: Compare result files
#- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
#- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
#- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
#- name: Check out repository code
# uses: actions/checkout@v4
#- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
#- run: echo "🖥️ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."