-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pytest coverage workflow & improve test config (#118)
* Add pytest coverage workflow & improve test config Introduced a GitHub Actions workflow for running tests with coverage analysis on Python 3.11 and 3.12. Updated test environment files and documentation to use `pytest-cov` for streamlined coverage reporting. Added continuous integration details to the development documentation.
- Loading branch information
1 parent
163abe5
commit e1dafa6
Showing
4 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: pytest-with-coverage | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
# Enable workflow to be triggered from GitHub CLI, browser, or via API | ||
# primarily for testing a conda environment solution for new Python versions | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pytest-with-coverage: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ '3.11', '3.12' ] | ||
uses: UBC-MOAD/gha-workflows/.github/workflows/pytest-with-coverage.yaml@main | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
conda-env-file: SalishSeaTools/envs/environment-test.yaml | ||
conda-env-name: salishsea-tools-test | ||
secrets: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# conda environment description file for SalishSeaTools package testing environment | ||
# | ||
# Creates a conda environment in which the SalishSeaTools package unit tests and | ||
# coverage analysis can be run. | ||
# Primarily intended to create a conda environment for use in a GitHub Actions workflow. | ||
|
||
name: salishsea-tools-test | ||
|
||
channels: | ||
- conda-forge | ||
- nodefaults | ||
|
||
dependencies: | ||
- arrow>=1.0.0 | ||
- bottleneck | ||
- cliff | ||
- cmocean | ||
- f90nml | ||
- gsw | ||
- h5netcdf | ||
- ipdb | ||
- ipython | ||
- jupyterlab | ||
- lxml | ||
- matplotlib | ||
- netCDF4 | ||
- numpy | ||
- openpyxl | ||
- pandas | ||
- pip | ||
- pytz | ||
- python-dateutil | ||
- pyyaml | ||
- requests | ||
- retrying | ||
- scipy | ||
- tqdm | ||
- xarray | ||
|
||
# For unit tests and coverage monitoring | ||
- coverage | ||
- pytest-cov | ||
|
||
# For documentation links checking | ||
- sphinx=8.1.3 | ||
- sphinx-notfound-page=1.0.4 | ||
- sphinx-rtd-theme=3.0.0 | ||
|
||
- pip: | ||
- angles | ||
|
||
# Install the SalishSeaTools packages in editable mode | ||
- --editable ../ |