Skip to content

Commit dea3de8

Browse files
committed
Add CI workflow and .gitignore file; configure Jupyter Notebook support
1 parent 7d92bb0 commit dea3de8

File tree

3 files changed

+292
-0
lines changed

3 files changed

+292
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.ipynb linguist-documentation

.github/workflows/ci.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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/"

.gitignore

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
wads_configs.json
2+
data/wads_configs.json
3+
wads/data/wads_configs.json
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
11+
.DS_Store
12+
# C extensions
13+
*.so
14+
15+
# TLS certificates
16+
## Ignore all PEM files anywhere
17+
*.pem
18+
## Also ignore any certs directory
19+
certs/
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
*.egg-info/
36+
.installed.cfg
37+
*.egg
38+
MANIFEST
39+
_build
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.coverage
55+
.coverage.*
56+
.cache
57+
nosetests.xml
58+
coverage.xml
59+
*.cover
60+
.hypothesis/
61+
.pytest_cache/
62+
63+
# Translations
64+
*.mo
65+
*.pot
66+
67+
# Django stuff:
68+
*.log
69+
local_settings.py
70+
db.sqlite3
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
docs/*
82+
83+
# PyBuilder
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# pyenv
90+
.python-version
91+
92+
# celery beat schedule file
93+
celerybeat-schedule
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
120+
# PyCharm
121+
.idea

0 commit comments

Comments
 (0)