Skip to content

Bump onnx from 1.18.0 to 1.21.0 #106

Bump onnx from 1.18.0 to 1.21.0

Bump onnx from 1.18.0 to 1.21.0 #106

Workflow file for this run

name: Build and test on self-hosted runners
on:
push:
branches-ignore:
- master
pull_request:
branches-ignore:
- master
jobs:
build_and_test_windows:
strategy:
matrix:
arch: [x86_64]
os: [windows]
python-version: ["3.10", "3.11", "3.12"]
runs-on: [self-hosted, Windows]
steps:
- name: Fix PATH to use Windows tar
if: runner.os == 'Windows'
run: |
echo "C:\Windows\System32" >> $env:GITHUB_PATH
echo "Fixed PATH for tar"
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
with:
key: venv-${{ runner.os }}-${{ matrix.python-version }}
path: .venv
- name: Install dependencies
shell: pwsh
run: |
python -m venv .venv
.venv\Scripts\python.exe -m pip install --upgrade pip
.venv\Scripts\python.exe -m pip install numpy pandas onnx jinja2 loguru typer fmpy cmake
.venv\Scripts\python.exe -m pip install -e .
- name: Python unit tests
shell: pwsh
run: |
.venv\Scripts\python.exe -m unittest tests.test_variables
.venv\Scripts\python.exe -m unittest tests.test_model
.venv\Scripts\python.exe -m unittest tests.test_model_description
.venv\Scripts\python.exe -m unittest tests.test_app.TestApp
.venv\Scripts\python.exe -m unittest tests.test_app.TestExample1
.venv\Scripts\python.exe -m unittest tests.test_app.TestExample2
.venv\Scripts\python.exe -m unittest tests.test_app.TestExample3
.venv\Scripts\python.exe -m unittest tests.test_app.TestExample4
- name: Build example4 FMI 2.0
shell: pwsh
run: |
$fmi_platform = "${{ matrix.arch }}-${{ matrix.os }}"
.venv\Scripts\onnx2fmu.exe build `
examples/example4/example4.onnx `
examples/example4/example4Description.json `
target `
--fmi-platform $fmi_platform `
--cmake-config Debug
- name: Build example4 FMI 3.0
shell: pwsh
run: |
$fmi_platform = "${{ matrix.arch }}-${{ matrix.os }}"
.venv\Scripts\onnx2fmu.exe build `
examples/example4/example4.onnx `
examples/example4/example4DescriptionFMI3.json `
target `
--fmi-platform $fmi_platform `
--cmake-config Debug
- name: Save cached virtualenv
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ matrix.python-version }}
path: .venv
build_and_test_linux:
strategy:
matrix:
arch: [x86_64]
os: [linux]
python-version: ["3.10", "3.11", "3.12"]
runs-on: [self-hosted, Linux]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
with:
key: venv-${{ runner.os }}-${{ matrix.python-version }}
path: .venv
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install numpy pandas onnx jinja2 loguru typer fmpy cmake
pip install -e .
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Python unit tests
run: |
python -m unittest tests.test_variables
python -m unittest tests.test_model
python -m unittest tests.test_model_description
python -m unittest tests.test_app.TestApp
python -m unittest tests.test_app.TestExample1
python -m unittest tests.test_app.TestExample2
python -m unittest tests.test_app.TestExample3
python -m unittest tests.test_app.TestExample4
- name: Build example4 FMI 2.0
shell: bash -l {0}
run: |
onnx2fmu build \
examples/example4/example4.onnx \
examples/example4/example4Description.json \
target \
--fmi-platform ${{ matrix.arch }}-${{ matrix.os }} \
--cmake-config Debug
- name: Save cached virtualenv
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ matrix.python-version }}
path: .venv