Repository navigation
110 lines (89 loc) · 3.53 KB
/
Copy pathci.yml
File metadata and controls
110 lines (89 loc) · 3.53 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
108
109
name: CI
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
env:
GIT_LFS_SKIP_SMUDGE: 1 # Skip LFS to avoid bandwidth quota issues
jobs:
test:
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-14]
# Track every CPython that publish.yml ships a wheel for (cp310-cp314),
# so a version we distribute is never untested. 3.14 was added after a
# Windows user on 3.14 hit the sdist fallback: no cp314 wheel existed,
# pip tried to compile the engine with nmake and failed.
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Rewrite SSH submodule URLs to HTTPS
# Kirchhoff (fetched at build time by CMake ExternalProject) declares its
# PSMA schema submodules with git@github.com: URLs, which a runner cannot
# authenticate -> "Permission denied (publickey)" and a failed wheel build.
# publish.yml already does this inside CIBW_BEFORE_ALL_*; CI never did,
# which is why every CI job was red on every OS while publish stayed green.
run: git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Install quicktype
run: npm install -g quicktype@23.2.6
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest
- name: Build and install package
run: |
pip install .
- name: Verify installation
run: |
python -c "import PyOpenMagnetics; print('PyOpenMagnetics loaded with', len(dir(PyOpenMagnetics)), 'functions')"
- name: Run tests
run: |
pytest tests/ -v --tb=short
continue-on-error: true # Some tests may require specific data files
build_check:
name: Build check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Rewrite SSH submodule URLs to HTTPS
# Kirchhoff (fetched at build time by CMake ExternalProject) declares its
# PSMA schema submodules with git@github.com: URLs, which a runner cannot
# authenticate -> "Permission denied (publickey)" and a failed wheel build.
# publish.yml already does this inside CIBW_BEFORE_ALL_*; CI never did,
# which is why every CI job was red on every OS while publish stayed green.
run: git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Install quicktype
run: npm install -g quicktype@23.2.6
- name: Install build
run: python -m pip install build
- name: Build package
run: python -m build
- name: Check built files
run: |
ls -la dist/
echo "--- Wheel contents ---"
python -m zipfile -l dist/*.whl | head -50