-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (78 loc) · 1.98 KB
/
python-app.yml
File metadata and controls
87 lines (78 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
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
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
python-version: "3.12"
permissions:
contents: read
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v3
with:
args: 'check'
- uses: astral-sh/ruff-action@v3
with:
args: 'format --check'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Run Ty
run: |
uv sync --all-extras
uvx ty check
doc-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build Doc
run: |
uv sync --all-extras --group doc
uv run mkdocs build
testing:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: [check-format, doc-test]
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
if: ${{runner.os != 'Windows' }}
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install openEMS for linux
if: ${{runner.os != 'Windows' }}
run: |
nix-channel --list
nix-channel --add https://nixos.org/channels/nixos-25.11 nixpkgs
nix-channel --update
nix-env -iA nixpkgs.openems
which openEMS
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.python-version }}
- name: Install Dependencies
run: |
uv tree
uv sync --group dev --all-extras
- name: Test with Pytest
run: |
uv run pytest -rxXs --basetemp=tmp
- name: Store reports
uses: actions/upload-artifact@v6
with:
name: reports-${{ matrix.os }}
path: |
tmp/
pytest.log