@@ -16,16 +16,28 @@ jobs:
1616 - uses : actions/setup-python@v5
1717 with :
1818 python-version : " 3.12"
19- - run : |
19+ # Run Ruff
20+ - name : Run Ruff
21+ run : |
2022 pip install uv
2123 uv pip install --system ruff
2224 ruff check
25+ # Run Codespell
26+ - name : Run Codespell
27+ run : |
28+ pip install codespell
29+ codespell codespell src/**/*.py
2330
2431 Test :
2532 runs-on : ubuntu-latest
2633 strategy :
2734 matrix :
28- python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
35+ python-version : ["3.9", "3.10", "3.11", "3.12"]
36+ os :
37+ - ubuntu-latest
38+ - macos-latest # arm64 (Apple Silicon)
39+ - macos-13 # latest Intel release
40+ - windows-latest
2941
3042 steps :
3143 - uses : actions/checkout@v4
3749 with :
3850 python-version : ${{ matrix.python-version }}
3951 - run : |
40- pipx install hatch
41- hatch run test
42-
52+ pip install pytest-notebook
53+ pip install pre-commit
54+ pre-commit run --all
55+ pre-commit install
56+ # pipx install hatch
57+ # hatch run test --cover --nb-test-files
58+ - name : Install IPyNiiVue & Deps
59+ run : pip install -e .
60+ - name : Test import
61+ run : |
62+ python -c "import ipyniivue"
63+ - name : Test IPyNiiVue
64+ run : |
65+ pip install pytest-cov
66+ pip install --upgrade pip ipython ipykernel
67+ ipython kernel install --name "python3" --user
68+ mkdir -p ./reports
69+ pytest --cov --cov-report=json:./reports/coverage.json --cov-report=xml:./reports/coverage.xml
70+ - name : Upload ipyniivue test coverage report
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : coverage_ipyniivue-${{ matrix.os }}-py${{ matrix.python-version }}
74+ path : ./reports/coverage.json
75+ - name : Generate Markdown summary of code coverage
76+ 77+ with :
78+ filename : ./reports/coverage.xml
79+ format : markdown
80+ output : both
81+ thresholds : " 10 10"
82+ - name : Add test results to job summary
83+ run : |
84+ cat ./code-coverage-results.md >> $GITHUB_STEP_SUMMARY
85+ - name : Test example notebooks
86+ run : |
87+ pip install nbmake
88+ rm -rf ./reports
89+ mkdir -p ./reports
90+ pytest --nbmake examples/*ipynb --cov --cov-report=json:./reports/coverage.json --cov-report=xml:./reports/coverage.xml
91+ - name : Upload ipyniivue example notbooks coverage report
92+ uses : actions/upload-artifact@v4
93+ with :
94+ name : coverage_ipyniivue_notebooks-${{ matrix.os }}-py${{ matrix.python-version }}
95+ path : ./reports/coverage.json
96+ - name : Generate Markdown summary of code coverage
97+ 98+ with :
99+ filename : ./reports/coverage.xml
100+ format : markdown
101+ output : both
102+ thresholds : " 10 10"
103+ - name : Add test results to job summary
104+ run : |
105+ cat ./code-coverage-results.md >> $GITHUB_STEP_SUMMARY
106+ # coverage run -m pytest --nb-test-files
107+ # nbt-test-files check for changes in the output of the notebook.
108+ # This does not work for our purpose since we wipe the output
109+ # before committing changes to facilitate integration with git.
110+ # - name: Upload coverage to codecov (Only do this for the ubuntu-latest job)
111+ # if: matrix.os == 'ubuntu-latest'
112+ # uses: codecov/codecov-action@v5
113+ # with:
114+ # token: ${{secrets.CODECOV_TOKEN}}
115+ #
43116 LintJavaScript :
44117 name : JavaScript / Lint
45118 runs-on : macos-14
0 commit comments