Add event model exchange support #143
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - '*' | |
| jobs: | |
| build-wrapper: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, windows-2022] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python 3.x | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Compile wrapper on Windows | |
| if: startsWith(runner.os, 'Windows') | |
| run: | | |
| mkdir tmp-build | |
| cd tmp-build | |
| cmake $Env:github_workspace/pythonfmu3/pythonfmu-export -DCMAKE_BUILD_TYPE=Release -A x64 | |
| cmake --build . --config Release | |
| cd .. | |
| - name: Compile wrapper on Linux / macOS | |
| if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
| run: | | |
| docker build -f DockerFile -t pythonfmu3-wrapper --target build . | |
| - name: Create container and copy out artifact | |
| if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
| run: | | |
| docker create --name extract pythonfmu3-wrapper | |
| docker cp extract:/io/pythonfmu3/resources $GITHUB_WORKSPACE/pythonfmu3 | |
| docker rm extract | |
| - name: Archive wrapper library | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lib-wrapper-${{ matrix.os }} | |
| path: pythonfmu3/resources | |
| build-python: | |
| needs: build-wrapper | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python 3.x | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Download wrappers | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: lib-wrapper-* | |
| path: pythonfmu3/resources | |
| merge-multiple: true | |
| - name: Build distribution artifacts | |
| run: | | |
| python -m pip install setuptools wheel | |
| python setup.py sdist bdist_wheel | |
| - name: Archive production artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-wheel | |
| path: dist | |
| test: | |
| needs: build-python | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, windows-2022] | |
| python-version: [3.7, 3.8, 3.9] | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python 3.x | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: 'x64' | |
| - name: Download python package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-wheel | |
| - name: Run the Tests | |
| run: | | |
| pip install -r requirements.txt | |
| cd python-wheel | |
| pip install pythonfmu3*.whl | |
| pip install fmpy | |
| pytest --pyargs pythonfmu3 | |
| cd .. | |
| shell: bash -l {0} |