-
Notifications
You must be signed in to change notification settings - Fork 563
58 lines (47 loc) · 1.98 KB
/
test_release.yml
File metadata and controls
58 lines (47 loc) · 1.98 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
# This workflow will create a Python package and upload it to testPyPi or PyPi
# Then, it installs pandapower from there and all dependencies and runs tests with different Python versions
name: test
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
branches:
- release/*
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
os: [ ubuntu-latest, windows-latest ]
group: [ 1, 2 ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a #v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --all-extras
uv pip install pytest-split
- name: Install specific dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
if ( '${{ matrix.python-version }}' -eq '3.10' ) { uv pip install pypower }
if ( '${{ matrix.python-version }}' -ne '3.10' ) { uv pip install numba }
if ( '${{ matrix.python-version }}' -eq '3.11' ) { uv pip install lightsim2grid }
- name: Install specific dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
if ${{ matrix.python-version == '3.10' }}; then uv pip install pypower; fi
if ${{ matrix.python-version != '3.10' }}; then uv pip install numba; fi
if ${{ matrix.python-version == '3.11' }}; then uv pip install lightsim2grid; fi
- name: List all installed packages
run: |
uv pip list
- name: Test with pytest
run: |
uv run pytest --splits 2 --group ${{ matrix.group }}