-
Notifications
You must be signed in to change notification settings - Fork 23
107 lines (89 loc) · 2.85 KB
/
Test.yml
File metadata and controls
107 lines (89 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Test-Build-Publish
on:
push:
branches: ['master']
tags:
- 'v*' # only publish when pushing version tags (e.g., v1.0.0)
pull_request:
workflow_dispatch:
jobs:
Test-Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.12', '3.13']
os: ['ubuntu-latest', 'windows-latest']
omc-version: ['stable']
timeout-minutes: 45
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Set up OpenModelica Compiler
uses: OpenModelica/setup-openmodelica@v1.0.6
with:
version: ${{ matrix.omc-version }}
packages: omc
libraries: 'Modelica 3.2.3'
- run: omc --version
- 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 numpy meson ninja twine
pip install . pytest pytest-md pytest-emoji
- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: true
job-summary: true
custom-arguments: '-v'
click-to-expand: true
report-title: 'Test Report'
- name: Build wheel
run: python -m build --wheel --outdir wheels
- name: Check twine
run: python -m twine check wheels/*
- name: Upload wheel artifact
uses: actions/upload-artifact@v7.0.0
with:
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: wheels/*
Publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: Test-Build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Ubuntu wheel artifact 3.12
uses: actions/download-artifact@v6
with:
name: wheel-ubuntu-latest-3.12
path: wheels/ubuntu
- name: Download Ubuntu wheel artifact 3.13
uses: actions/download-artifact@v6
with:
name: wheel-ubuntu-latest-3.13
path: wheels/ubuntu
- name: Download Windows wheel artifact 3.12
uses: actions/download-artifact@v6
with:
name: wheel-windows-latest-3.12
path: wheels/windows
- name: Download Windows wheel artifact 3.13
uses: actions/download-artifact@v6
with:
name: wheel-windows-latest-3.13
path: wheels/windows
- name: Install twine
run: python -m pip install --upgrade twine
- name: Publish all wheels to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_OMSENS_API_TOKEN }}
run: |
python -m twine upload wheels/ubuntu/* wheels/windows/* --skip-existing