mantielero is testing out GitHub Actions 🚀 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nim compilation - Model Exchange | ||
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 | ||
modeltype: | ||
- fmu2me | ||
- fmu2cs | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: iffy/install-nim@v5 | ||
with: | ||
nim-version: ${{ matrix.nimversion }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- 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 | ||
- 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' | ||
- name: Install fmu.nim | ||
run: | | ||
nimble install -y | ||
- name: Create inc.fmu as fmu2me=Model exchange or fmu2cs=Co-Simulation - now=${{ matrix.modeltype }} | ||
with: | ||
modeltype: ${{ matrix.modeltype }} | ||
run: | | ||
Check failure on line 54 in .github/workflows/ci-nim.yml GitHub Actions / nim compilation - Model ExchangeInvalid workflow file
|
||
cd examples/inc | ||
nim c -r -d:${{ matrix.modeltype }} 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' | ||
#${{matrix.target == 'windows'}} | ||
- name: Execute FMU checker over inc.fmu in Windows - enables seeing why it fails when it does | ||
shell: bash | ||
run: | | ||
cd examples/inc | ||
fmuCheck.win64.exe -h 1 -s 14 -f inc.fmu | ||
if: runner.os == 'Windows' | ||
- name: Execute FMU checker over inc.fmu in Windows (Testing bash) | ||
shell: bash | ||
run: | | ||
cd examples/inc | ||
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_win64.csv | ||
second_file_path: examples/inc/inc.csv | ||
expected_result: PASSED | ||
if: runner.os == 'Windows' | ||
- 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 | ||
if: runner.os == 'Linux' | ||
- run: echo "This job's status is ${{ job.status }}." |