1+ name : Continuous Integration (Modern)
2+ on : [push, pull_request]
3+
4+ env :
5+ PROJECT_NAME : ij
6+
7+ jobs :
8+ validation :
9+ name : Validation
10+ if : " !contains(github.event.head_commit.message, '[skip ci]')"
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ python-version : ["3.10", "3.12"]
15+
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Install Dependencies
25+ uses : i2mint/wads/actions/install-deps@master
26+ with :
27+ dependency-files : pyproject.toml
28+ extras : dev,test
29+ # Fallback for projects still using setup.cfg:
30+ # dependency-files: setup.cfg
31+ # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # Uncomment for private dependencies
32+
33+ - name : Format Source Code
34+ uses : i2mint/wads/actions/ruff-format@master
35+ with :
36+ line-length : 88
37+ target-path : .
38+
39+ - name : Lint Validation
40+ uses : i2mint/wads/actions/ruff-lint@master
41+ with :
42+ root-dir : ${{ env.PROJECT_NAME }}
43+ output-format : github
44+ # Ruff will read configuration from pyproject.toml
45+
46+ - name : Run Tests
47+ uses : i2mint/wads/actions/run-tests@master
48+ with :
49+ root-dir : ${{ env.PROJECT_NAME }}
50+ exclude : examples,scrap
51+ coverage : true
52+ pytest-args : -v --tb=short
53+
54+ windows-validation :
55+ name : Windows Tests (Informational)
56+ if : " !contains(github.event.head_commit.message, '[skip ci]')"
57+ runs-on : windows-latest
58+ continue-on-error : true # Don't fail the entire workflow if Windows tests fail
59+
60+ steps :
61+ - uses : actions/checkout@v4
62+
63+ - name : Set up Python 3.10
64+ uses : actions/setup-python@v5
65+ with :
66+ python-version : " 3.10"
67+
68+ - name : Install Dependencies
69+ uses : i2mint/wads/actions/install-deps@master
70+ with :
71+ dependency-files : pyproject.toml
72+ extras : dev,test
73+
74+ - name : Run tests
75+ id : test
76+ continue-on-error : true
77+ run : pytest
78+
79+ - name : Report test results
80+ if : always()
81+ run : |
82+ if [ "${{ steps.test.outcome }}" == "failure" ]; then
83+ echo "::warning::Windows tests failed but workflow continues"
84+ echo "## ⚠️ Windows Tests Failed" >> $GITHUB_STEP_SUMMARY
85+ echo "Tests failed on Windows but this is informational only." >> $GITHUB_STEP_SUMMARY
86+ else
87+ echo "## ✅ Windows Tests Passed" >> $GITHUB_STEP_SUMMARY
88+ fi
89+
90+ publish :
91+ name : Publish
92+ if : " !contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')"
93+ needs : validation
94+ runs-on : ubuntu-latest
95+ strategy :
96+ matrix :
97+ python-version : ["3.12"]
98+
99+ steps :
100+ - uses : actions/checkout@v4
101+ with :
102+ fetch-depth : 0
103+ token : ${{ secrets.GITHUB_TOKEN }}
104+
105+ - name : Set up Python ${{ matrix.python-version }}
106+ uses : actions/setup-python@v5
107+ with :
108+ python-version : ${{ matrix.python-version }}
109+
110+ - name : Format Source Code
111+ uses : i2mint/wads/actions/ruff-format@master
112+
113+ - name : Update Version Number
114+ id : version
115+ uses : i2mint/isee/actions/bump-version-number@master
116+
117+ - name : Build Distribution
118+ uses : i2mint/wads/actions/build-dist@master
119+ with :
120+ sdist : true
121+ wheel : true
122+ # Uncomment for private dependencies:
123+ # with:
124+ # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
125+
126+ - name : Publish to PyPI
127+ uses : i2mint/wads/actions/pypi-upload@master
128+ with :
129+ pypi-username : ${{ secrets.PYPI_USERNAME }}
130+ pypi-password : ${{ secrets.PYPI_PASSWORD }}
131+ skip-existing : false
132+
133+ - name : Track Code Metrics
134+ uses : i2mint/umpyre/actions/track-metrics@master
135+ continue-on-error : true # Don't fail CI if metrics collection fails
136+ with :
137+ github-token : ${{ secrets.GITHUB_TOKEN }}
138+ config-path : .github/umpyre-config.yml # Optional: defaults to .umpyre.yml
139+
140+ - name : Commit Changes
141+ uses : i2mint/wads/actions/git-commit@master
142+ with :
143+ commit-message : " **CI** Formatted code + Updated version to ${{ steps.version.outputs.version }} [skip ci]"
144+ ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
145+ push : true
146+
147+ - name : Tag Repository
148+ uses : i2mint/wads/actions/git-tag@master
149+ with :
150+ tag : ${{ steps.version.outputs.version }}
151+ message : " Release version ${{ steps.version.outputs.version }}"
152+ push : true
153+
154+ github-pages :
155+ name : Publish GitHub Pages
156+
157+ permissions :
158+ contents : write
159+ pages : write
160+ id-token : write
161+
162+ if : " !contains(github.event.head_commit.message, '[skip ci]') && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)"
163+ needs : publish
164+ runs-on : ubuntu-latest
165+
166+ steps :
167+ - uses : i2mint/epythet/actions/publish-github-pages@master
168+ with :
169+ github-token : ${{ secrets.GITHUB_TOKEN }}
170+ ignore : " tests/,scrap/,examples/"
0 commit comments