Skip to content

Commit 28b78f5

Browse files
committed
fix: Update CI workflow to use standard Python setup
- Remove ivpm bootstrap dependency (use actions/setup-python@v5) - Update upload-artifact to v4 (v3 is deprecated) - Add Python 3.10, 3.11, 3.12 test matrix - Update codecov-action to v4 - Fix documentation publish branch (main not master) - Simplify all jobs to use standard python commands
1 parent b51a15b commit 28b78f5

File tree

1 file changed

+53
-36
lines changed

1 file changed

+53
-36
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,88 +8,100 @@ on:
88
jobs:
99
ci-linux:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ['3.10', '3.11', '3.12']
1114
steps:
1215
- uses: actions/checkout@v4
1316

14-
- name: Configure Python
15-
run: |
16-
# Install dependencies required to load ivpm.yaml file
17-
./bootstrap.sh
18-
./packages/python/bin/python3 -m pip install setuptools build --upgrade
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
1921

2022
- name: Install Dependencies
2123
run: |
22-
./packages/python/bin/python3 -m pip install -e ".[dev]"
24+
python -m pip install --upgrade pip setuptools wheel
25+
python -m pip install -e ".[dev]"
2326
2427
- name: Run Linters
2528
run: |
26-
# Run basic linting checks
27-
./packages/python/bin/python3 -m pip install ruff mypy
28-
./packages/python/bin/ruff check src/pywellen_mcp/ || true
29-
./packages/python/bin/mypy src/pywellen_mcp/ --ignore-missing-imports || true
29+
python -m pip install ruff mypy
30+
ruff check src/pywellen_mcp/ || true
31+
mypy src/pywellen_mcp/ --ignore-missing-imports || true
3032
3133
- name: Run Unit Tests
3234
run: |
33-
export PYTHONPATH=$(pwd)/src:$(pwd)/tests
34-
./packages/python/bin/pytest tests/unit/ -v --cov=pywellen_mcp --cov-report=xml --cov-report=term
35+
pytest tests/unit/ -v --cov=pywellen_mcp --cov-report=xml --cov-report=term
3536
3637
- name: Upload Coverage
37-
uses: codecov/codecov-action@v3
38+
if: matrix.python-version == '3.11'
39+
uses: codecov/codecov-action@v4
3840
with:
3941
file: ./coverage.xml
4042
flags: unittests
4143
name: codecov-pywellen-mcp
4244

4345
- name: Build Package
46+
if: matrix.python-version == '3.11'
4447
run: |
48+
python -m pip install build
4549
# Update version with build number for development releases
4650
if [[ ! "${{ github.ref }}" =~ ^refs/tags/v ]]; then
4751
sed -i -e "s/version = \"\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\"/version = \"\1.dev${GITHUB_RUN_ID}\"/g" pyproject.toml
4852
fi
49-
./packages/python/bin/python3 -m build .
53+
python -m build .
5054
5155
- name: Build Documentation
56+
if: matrix.python-version == '3.11'
5257
run: |
53-
./packages/python/bin/python3 -m pip install sphinx sphinx-rtd-theme myst-parser
54-
./packages/python/bin/sphinx-build -M html ./docs build
55-
touch build/html/.nojekyll
58+
python -m pip install -e ".[docs]"
59+
cd docs && make html
60+
touch _build/html/.nojekyll
5661
5762
- name: Upload Package Artifacts
58-
uses: actions/upload-artifact@v3
63+
if: matrix.python-version == '3.11'
64+
uses: actions/upload-artifact@v4
5965
with:
6066
name: python-package
6167
path: dist/
6268

6369
- name: Upload Documentation Artifacts
64-
uses: actions/upload-artifact@v3
70+
if: matrix.python-version == '3.11'
71+
uses: actions/upload-artifact@v4
6572
with:
6673
name: documentation
67-
path: build/html/
74+
path: docs/_build/html/
6875

6976
- name: Publish to PyPI
70-
if: startsWith(github.ref, 'refs/tags/v')
77+
if: matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/v')
7178
uses: pypa/gh-action-pypi-publish@release/v1
7279
with:
7380
user: __token__
7481
password: ${{ secrets.PYPI_API_TOKEN }}
7582

7683
- name: Publish Documentation
77-
if: startsWith(github.ref, 'refs/heads/master')
84+
if: matrix.python-version == '3.11' && github.ref == 'refs/heads/main'
7885
uses: JamesIves/github-pages-deploy-action@v4.4.1
7986
with:
8087
branch: gh-pages
81-
folder: build/html
88+
folder: docs/_build/html
8289

8390
ci-integration:
8491
runs-on: ubuntu-latest
8592
needs: ci-linux
8693
steps:
8794
- uses: actions/checkout@v4
8895

89-
- name: Configure Python
96+
- name: Set up Python
97+
uses: actions/setup-python@v5
98+
with:
99+
python-version: '3.11'
100+
101+
- name: Install Dependencies
90102
run: |
91-
./bootstrap.sh
92-
./packages/python/bin/python3 -m pip install -e ".[dev]"
103+
python -m pip install --upgrade pip
104+
python -m pip install -e ".[dev]"
93105
94106
- name: Download Test Waveforms
95107
run: |
@@ -101,32 +113,37 @@ jobs:
101113
- name: Run Integration Tests
102114
run: |
103115
# Run integration tests when available
104-
# ./packages/python/bin/pytest tests/integration/ -v
116+
# pytest tests/integration/ -v
105117
echo "Integration tests would run here"
106118
107119
- name: Performance Benchmarks
108120
run: |
109121
# Run performance benchmarks
110-
# ./packages/python/bin/python3 scripts/benchmark.py
122+
# python scripts/benchmark.py
111123
echo "Performance benchmarks would run here"
112124
113125
ci-security:
114126
runs-on: ubuntu-latest
115127
steps:
116128
- uses: actions/checkout@v4
117129

118-
- name: Configure Python
130+
- name: Set up Python
131+
uses: actions/setup-python@v5
132+
with:
133+
python-version: '3.11'
134+
135+
- name: Install Dependencies
119136
run: |
120-
./bootstrap.sh
121-
./packages/python/bin/python3 -m pip install -e ".[dev]"
137+
python -m pip install --upgrade pip
138+
python -m pip install -e ".[dev]"
122139
123140
- name: Security Scan
124141
run: |
125-
./packages/python/bin/python3 -m pip install bandit safety
126-
./packages/python/bin/bandit -r src/pywellen_mcp/ -ll || true
127-
./packages/python/bin/safety check || true
142+
python -m pip install bandit safety
143+
bandit -r src/pywellen_mcp/ -ll || true
144+
safety check || true
128145
129146
- name: Dependency Audit
130147
run: |
131-
./packages/python/bin/python3 -m pip list --format=json | \
132-
./packages/python/bin/python3 -c "import sys,json; [print(p['name']+'=='+p['version']) for p in json.load(sys.stdin)]"
148+
python -m pip list --format=json | \
149+
python -c "import sys,json; [print(p['name']+'=='+p['version']) for p in json.load(sys.stdin)]"

0 commit comments

Comments
 (0)