|
| 1 | +name: Test-v4.x.x |
| 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 | + # * Windows using windows-latest |
| 18 | + os: ['ubuntu-latest', 'windows-latest'] |
| 19 | + # * OM stable - latest stable version |
| 20 | + # * OM nightly - latest nightly build |
| 21 | + omc-version: ['stable', 'nightly'] |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v6 |
| 25 | + |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v6 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + architecture: 'x64' |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + python -m pip install --upgrade pip build setuptools wheel twine |
| 35 | + pip install . pytest pytest-md pytest-emoji pre-commit |
| 36 | +
|
| 37 | + - name: Set timezone |
| 38 | + uses: szenius/set-timezone@v2.0 |
| 39 | + with: |
| 40 | + timezoneLinux: 'Europe/Berlin' |
| 41 | + |
| 42 | + - name: Run pre-commit linters |
| 43 | + run: 'pre-commit run --all-files' |
| 44 | + |
| 45 | + - name: "Set up OpenModelica Compiler" |
| 46 | + uses: OpenModelica/setup-openmodelica@v1.0.6 |
| 47 | + with: |
| 48 | + version: ${{ matrix.omc-version }} |
| 49 | + packages: | |
| 50 | + omc |
| 51 | + libraries: | |
| 52 | + 'Modelica 4.0.0' |
| 53 | + - run: "omc --version" |
| 54 | + |
| 55 | + - name: Pull OpenModelica docker image |
| 56 | + if: runner.os != 'Windows' |
| 57 | + run: docker pull openmodelica/openmodelica:v1.25.0-minimal |
| 58 | + |
| 59 | + - name: Build wheel and sdist packages |
| 60 | + run: python -m build --wheel --sdist --outdir dist |
| 61 | + |
| 62 | + - name: Check twine |
| 63 | + run: python -m twine check dist/* |
| 64 | + |
| 65 | + - name: Run pytest |
| 66 | + uses: pavelzw/pytest-action@v2 |
| 67 | + with: |
| 68 | + verbose: true |
| 69 | + emoji: true |
| 70 | + job-summary: true |
| 71 | + custom-arguments: '-v ./tests ' |
| 72 | + click-to-expand: true |
| 73 | + report-title: 'Test Report' |
0 commit comments