2727 images : ghcr.io/OpenModelica/crossbuild
2828
2929 - name : Log in to GitHub Container Registry
30- uses : docker/login-action@v2
30+ uses : docker/login-action@v3
3131 with :
3232 registry : ghcr.io
3333 username : ${{ github.actor }}
@@ -42,27 +42,36 @@ jobs:
4242 push : true
4343 tags : ${{ steps.meta.outputs.tags }}
4444
45- # Expose the image tag(s) produced by the metadata action as a job output so
46- # downstream jobs can reference and pull the exact image.
4745 outputs :
4846 image : ${{ steps.meta.outputs.tags }}
4947
50-
5148 test-compile :
5249 name : Test Docker image across toolchains
5350 needs : build
5451 runs-on : ubuntu-latest
5552 strategy :
5653 fail-fast : false
5754 matrix :
58- toolchain : ["i686-linux-gnu", "i686-w64-mingw32", "x86_64-linux-gnu", "x86_64-w64-mingw32"]
59- timeout-minutes : 60
55+ include :
56+ - toolchain : i686-linux-gnu
57+ fmi_platform_tuple : linux32
58+ lib_extension : so
59+ - toolchain : x86_64-linux-gnu
60+ fmi_platform_tuple : linux64
61+ lib_extension : so
62+ - toolchain : i686-w64-mingw32
63+ fmi_platform_tuple : win32
64+ lib_extension : dll
65+ - toolchain : x86_64-w64-mingw32
66+ fmi_platform_tuple : win64
67+ lib_extension : dll
68+ timeout-minutes : 15
6069 steps :
6170 - name : Check out the repo
6271 uses : actions/checkout@v5
6372
6473 - name : Log in to GitHub Container Registry
65- uses : docker/login-action@v2
74+ uses : docker/login-action@v3
6675 with :
6776 registry : ghcr.io
6877 username : ${{ github.actor }}
@@ -77,19 +86,62 @@ jobs:
7786 shell : bash
7887 env :
7988 TOOLCHAIN : ${{ matrix.toolchain }}
89+ FMI_PLATFORM_TUPLE : ${{ matrix.fmi_platform_tuple }}
90+ LIB_EXTENSION : ${{ matrix.lib_extension }}
8091 run : |
81- # Strip potential .cmake suffix and construct toolchain file path inside container
82- TOOLCHAIN_BASE="${TOOLCHAIN%%.cmake}"
83- TOOLCHAIN_FILE="/work/toolchain/${TOOLCHAIN_BASE}.cmake"
84-
8592 docker run --rm \
8693 -v "${{ github.workspace }}":/work \
8794 -w /work \
8895 "${{ needs.build.outputs.image }}" \
8996 bash -lc "\
9097 cmake -S test/resources/FMU_Interaction1/sources \
91- -B test/resources/FMU_Interaction1/sources/build_${TOOLCHAIN_BASE } \
98+ -B test/resources/FMU_Interaction1/sources/build_${TOOLCHAIN } \
9299 -DFMI_INTERFACE_HEADER_FILES_DIRECTORY=/work/test/resources/fmi \
93- -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} && \
94- cmake --build test/resources/FMU_Interaction1/sources/build_${TOOLCHAIN_BASE} --target install && \
95- test -f test/resources/FMU_Interaction1/binaries/linux64/Interaction1.so"
100+ -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/toolchain/${TOOLCHAIN}.cmake && \
101+ cmake --build test/resources/FMU_Interaction1/sources/build_${TOOLCHAIN} --target install && \
102+ test -f test/resources/FMU_Interaction1/binaries/${FMI_PLATFORM_TUPLE}/Interaction1.${LIB_EXTENSION} && \
103+ cmake --build test/resources/FMU_Interaction1/sources/build_${TOOLCHAIN} --target create_fmu"
104+
105+ - name : Upload Interaction1.fmu
106+ uses : actions/upload-artifact@v5
107+ with :
108+ name : Interaction1-${{ matrix.toolchain }}
109+ path : test/resources/Interaction1.fmu
110+ if-no-files-found : error
111+
112+ test-import :
113+ name : Test FMU import across systems
114+ needs : test-compile
115+ runs-on : ${{ matrix.os }}
116+ strategy :
117+ fail-fast : false
118+ matrix :
119+ include :
120+ - os : ubuntu-latest
121+ fmu_artifact : Interaction1-x86_64-linux-gnu
122+ - os : windows-latest
123+ fmu_artifact : Interaction1-x86_64-w64-mingw32
124+
125+ timeout-minutes : 30
126+ steps :
127+ - name : Download Interaction1.fmu
128+ uses : actions/download-artifact@v5
129+ with :
130+ name : ${{ matrix.fmu_artifact }}
131+
132+ - name : Install OMSimulator
133+ uses :
OpenModelica/[email protected] 134+ with :
135+ version : ' 1'
136+ packages : |
137+ 'omc'
138+ 'omsimulator'
139+
140+ - name : Simulate 64-bit Linux FMU
141+ if : runner.os == 'Linux'
142+ shell : bash
143+ run : OMSimulator Interaction1.fmu
144+
145+ - name : Simulate 64-bit Windows FMU
146+ if : runner.os == 'Windows'
147+ run : OMSimulator.exe Interaction1.fmu
0 commit comments