Skip to content

Commit 7744c82

Browse files
committed
Merge branch 'master+' into H001-remove_deprecated-OMCPath2
2 parents 708d362 + e99f3b7 commit 7744c82

2 files changed

Lines changed: 108 additions & 10 deletions

File tree

.github/workflows/Test.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: Test-Publish
22

33
on:
4-
push:
5-
branches: [ 'master' ]
6-
tags:
7-
- 'v*' # only publish when pushing version tags (e.g., v1.0.0)
8-
pull_request:
94
workflow_dispatch:
105

116
jobs:
@@ -17,13 +12,13 @@ jobs:
1712
# test for:
1813
# * oldest supported version
1914
# * latest available Python version
20-
python-version: [ '3.12', '3.14' ]
15+
python-version: ['3.10', '3.14']
2116
# * Linux using ubuntu-latest
2217
# * Windows using windows-latest
23-
os: [ 'ubuntu-latest', 'windows-latest' ]
18+
os: ['ubuntu-latest', 'windows-latest']
2419
# * OM stable - latest stable version
2520
# * OM nightly - latest nightly build
26-
omc-version: [ 'stable', 'nightly' ]
21+
omc-version: ['stable', 'nightly']
2722

2823
steps:
2924
- uses: actions/checkout@v6
@@ -83,8 +78,8 @@ jobs:
8378
needs: test
8479
strategy:
8580
matrix:
86-
python-version: [ '3.12' ]
87-
os: [ 'ubuntu-latest' ]
81+
python-version: ['3.10']
82+
os: ['ubuntu-latest']
8883
if: startsWith(github.ref, 'refs/tags/')
8984
steps:
9085
- uses: actions/checkout@v6
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Test-ubuntu-nightly
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
runs-on: ${{ matrix.os }}
9+
timeout-minutes: 30
10+
strategy:
11+
matrix:
12+
# test for:
13+
# * oldest supported version
14+
# * latest available Python version
15+
python-version: ['3.10', '3.14']
16+
# * Linux using ubuntu-latest
17+
os: ['ubuntu-latest']
18+
# * OM nightly - latest nightly build
19+
omc-version: ['nightly']
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
architecture: 'x64'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip build setuptools wheel twine
33+
pip install . pytest pytest-md pytest-emoji pre-commit
34+
35+
- name: Set timezone
36+
uses: szenius/set-timezone@v2.0
37+
with:
38+
timezoneLinux: 'Europe/Berlin'
39+
40+
- name: Run pre-commit linters
41+
run: 'pre-commit run --all-files'
42+
43+
- name: "Set up OpenModelica Compiler"
44+
uses: OpenModelica/setup-openmodelica@v1.0.6
45+
with:
46+
version: ${{ matrix.omc-version }}
47+
packages: |
48+
omc
49+
libraries: |
50+
'Modelica 4.0.0'
51+
- run: "omc --version"
52+
53+
- name: Pull OpenModelica docker image
54+
if: runner.os != 'Windows'
55+
run: docker pull openmodelica/openmodelica:v1.25.0-minimal
56+
57+
- name: Build wheel and sdist packages
58+
run: python -m build --wheel --sdist --outdir dist
59+
60+
- name: Check twine
61+
run: python -m twine check dist/*
62+
63+
- name: Run pytest
64+
uses: pavelzw/pytest-action@v2
65+
with:
66+
verbose: true
67+
emoji: true
68+
job-summary: true
69+
custom-arguments: '-v'
70+
click-to-expand: true
71+
report-title: 'Test Report'
72+
73+
Publish:
74+
name: Publish to PyPI
75+
runs-on: ${{ matrix.os }}
76+
needs: test
77+
strategy:
78+
matrix:
79+
python-version: ['3.10']
80+
os: ['ubuntu-latest']
81+
if: startsWith(github.ref, 'refs/tags/')
82+
steps:
83+
- uses: actions/checkout@v6
84+
85+
- name: Set up Python ${{ matrix.python-version }}
86+
uses: actions/setup-python@v6
87+
with:
88+
python-version: ${{ matrix.python-version }}
89+
architecture: 'x64'
90+
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install --upgrade pip build setuptools wheel twine
94+
95+
- name: Build wheel and sdist packages
96+
run: python -m build --wheel --sdist --outdir dist
97+
98+
- name: Publish wheel and sdist packages to PyPI
99+
env:
100+
TWINE_USERNAME: __token__
101+
TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }}
102+
run: |
103+
python -m twine upload dist/* --skip-existing

0 commit comments

Comments
 (0)