From cf2ea8da7c17e7788a0cb41edd98b3b276558a9c Mon Sep 17 00:00:00 2001 From: syntron Date: Thu, 21 May 2026 20:39:22 +0200 Subject: [PATCH] WN+WS --- .github/workflows/Test_WN.yml | 120 ++++++++++++++++++++++++++++++++++ .github/workflows/Test_WS.yml | 120 ++++++++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+) create mode 100644 .github/workflows/Test_WN.yml create mode 100644 .github/workflows/Test_WS.yml diff --git a/.github/workflows/Test_WN.yml b/.github/workflows/Test_WN.yml new file mode 100644 index 00000000..bd9d490a --- /dev/null +++ b/.github/workflows/Test_WN.yml @@ -0,0 +1,120 @@ +name: Test-WinNightly + +on: + push: + branches: ['master'] + tags: + - 'v*' # only publish when pushing version tags (e.g., v1.0.0) + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ${{ matrix.os }} + timeout-minutes: 45 + strategy: + matrix: + # test for: + # * oldest supported version + # * latest available Python version + python-version: ['3.14'] + # * Linux using ubuntu-latest + # * Windows using windows-latest + os: ['windows-latest'] + # * OM stable - latest stable version + # * OM nightly - latest nightly build + omc-version: ['nightly'] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build setuptools wheel twine + pip install . pytest pytest-md pytest-emoji pre-commit + + - name: Set timezone + uses: szenius/set-timezone@v2.0 + with: + timezoneLinux: 'Europe/Berlin' + + - name: Run pre-commit linters + run: 'pre-commit run --all-files' + + - name: "Set up OpenModelica Compiler" + uses: OpenModelica/setup-openmodelica@v1.0.7 + with: + version: ${{ matrix.omc-version }} + packages: | + omc + libraries: | + 'Modelica 4.0.0' + - run: "omc --version" + + - name: Pull OpenModelica docker image + if: runner.os != 'Windows' + run: docker pull openmodelica/openmodelica:v1.25.0-minimal + + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Check twine + run: python -m twine check dist/* + + - name: Run pytest + uses: pavelzw/pytest-action@v2 + with: + verbose: true + emoji: true + job-summary: true + custom-arguments: '-v ./tests' + click-to-expand: true + report-title: 'Test Report' + + - name: Run pytest based on v4.0.0 compatibility layer + uses: pavelzw/pytest-action@v2 + with: + verbose: true + emoji: true + job-summary: true + custom-arguments: '-v ./tests_v400' + click-to-expand: true + report-title: 'Test Report (v4.0.0 compatibility layer)' + + Publish: + name: Publish to PyPI + runs-on: ${{ matrix.os }} + needs: test + strategy: + matrix: + python-version: ['3.10'] + os: ['ubuntu-latest'] + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build setuptools wheel twine + + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Publish wheel and sdist packages to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }} + run: | + python -m twine upload dist/* --skip-existing diff --git a/.github/workflows/Test_WS.yml b/.github/workflows/Test_WS.yml new file mode 100644 index 00000000..2d89a478 --- /dev/null +++ b/.github/workflows/Test_WS.yml @@ -0,0 +1,120 @@ +name: Test-WinStable + +on: + push: + branches: ['master'] + tags: + - 'v*' # only publish when pushing version tags (e.g., v1.0.0) + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ${{ matrix.os }} + timeout-minutes: 45 + strategy: + matrix: + # test for: + # * oldest supported version + # * latest available Python version + python-version: ['3.14'] + # * Linux using ubuntu-latest + # * Windows using windows-latest + os: ['windows-latest'] + # * OM stable - latest stable version + # * OM nightly - latest nightly build + omc-version: ['stable'] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build setuptools wheel twine + pip install . pytest pytest-md pytest-emoji pre-commit + + - name: Set timezone + uses: szenius/set-timezone@v2.0 + with: + timezoneLinux: 'Europe/Berlin' + + - name: Run pre-commit linters + run: 'pre-commit run --all-files' + + - name: "Set up OpenModelica Compiler" + uses: OpenModelica/setup-openmodelica@v1.0.7 + with: + version: ${{ matrix.omc-version }} + packages: | + omc + libraries: | + 'Modelica 4.0.0' + - run: "omc --version" + + - name: Pull OpenModelica docker image + if: runner.os != 'Windows' + run: docker pull openmodelica/openmodelica:v1.25.0-minimal + + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Check twine + run: python -m twine check dist/* + + - name: Run pytest + uses: pavelzw/pytest-action@v2 + with: + verbose: true + emoji: true + job-summary: true + custom-arguments: '-v ./tests' + click-to-expand: true + report-title: 'Test Report' + + - name: Run pytest based on v4.0.0 compatibility layer + uses: pavelzw/pytest-action@v2 + with: + verbose: true + emoji: true + job-summary: true + custom-arguments: '-v ./tests_v400' + click-to-expand: true + report-title: 'Test Report (v4.0.0 compatibility layer)' + + Publish: + name: Publish to PyPI + runs-on: ${{ matrix.os }} + needs: test + strategy: + matrix: + python-version: ['3.10'] + os: ['ubuntu-latest'] + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build setuptools wheel twine + + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Publish wheel and sdist packages to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }} + run: | + python -m twine upload dist/* --skip-existing