Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e94722f
Add workflow to build and push the Docker image
ddundo Feb 14, 2025
b86c10d
Move workflow to the right directory
ddundo Feb 14, 2025
a502e62
Add pytest dependency to pyproject.toml
ddundo Feb 14, 2025
5eae8fd
Add workflow to run tests
ddundo Feb 14, 2025
dfef3fe
Fix branch name
ddundo Feb 14, 2025
821206c
Run the `initialize` script after reinstalling PyGEM
ddundo Feb 14, 2025
1a9aba8
Use pygem-community/pygem image
ddundo Feb 14, 2025
0f64363
Measure and report coverage
ddundo Feb 14, 2025
6d50e55
Omit `pygem/tests/*` from coverage
ddundo Feb 14, 2025
a6feeaa
Add coverage to dependencies
ddundo Feb 14, 2025
0a6dfde
Remove failing `test_oggm_compat.py`
ddundo Feb 14, 2025
de1f770
Run linter in test suite
ddundo Feb 15, 2025
ee3b95d
Linter dropped for now
ddundo Feb 26, 2025
4b4fed3
No longer need to activate venv [skip ci]
ddundo Feb 26, 2025
3f415b9
Do not run `initialize`
ddundo Feb 27, 2025
e2e8ad9
Trigger on push to dev branch
ddundo Feb 27, 2025
1a1dea5
Support scheduled runs on master and dev branches
ddundo Feb 27, 2025
887a3e7
Minor
Feb 27, 2025
03d1030
Move condition to matrix
Feb 27, 2025
b5e18d8
Fix branch reference
Feb 27, 2025
62016ed
Add `[tool.coverage.report]` to `pyproject.toml`
Feb 27, 2025
1e5e193
Fix branch reference try 2
Feb 27, 2025
c2be629
Fix branch reference try 3
Feb 27, 2025
bc50574
Fix branch reference try 4
Feb 27, 2025
4342078
Replace coverage with pytest-cov in dependencies
Feb 27, 2025
a4acb72
Simplify matrix condition
Feb 27, 2025
3fa777e
Simplify matrix condition try 2
Feb 27, 2025
ec4509a
Revert: Do not support scheduled runs on `dev` branch
Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'Install PyGEM and Run Test Suite'

on:
push:
branches:
- master
- dev
paths:
- '**.py'
- '.github/workflows/test_suite.yml'
- 'pyproject.toml'

pull_request:
paths:
- '**.py'
- '.github/workflows/test_suite.yml'
- 'pyproject.toml'

# Run test suite every Saturday at 1AM GMT (1 hour after the Docker image is updated)
schedule:
- cron: '0 1 * * 6'

# Stop the workflow if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_suite:
name: 'Test suite'
runs-on: ubuntu-latest

# Use pygem:latest for master branch and pygem:dev otherwise
container:
image: ghcr.io/pygem-community/pygem:${{ github.ref == 'refs/heads/master' && 'latest' || 'dev' }}
options: --user root

steps:
- name: 'Checkout the repo'
id: checkout
uses: actions/checkout@v4

- name: 'Reinstall PyGEM'
run: pip install --break-system-packages -e .

- name: 'Run tests'
run: |
python3 -m coverage erase
python3 -m pytest --cov=pygem -v --durations=20 pygem/tests
78 changes: 0 additions & 78 deletions pygem/tests/test_oggm_compat.py

This file was deleted.

9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jupyter = "^1.1.1"
arviz = "^0.20.0"
oggm = "^1.6.2"
ruamel-yaml = "^0.18.10"
pytest = ">=8.3.4"
pytest-cov = ">=6.0.0"

[tool.poetry.scripts]
initialize = "pygem.bin.op.initialize:main"
Expand All @@ -53,4 +55,9 @@ duplicate_gdirs = "pygem.bin.op.duplicate_gdirs:main"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"

[tool.coverage.report]
omit = ["pygem/tests/*"]
show_missing = true
skip_empty = true