-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
1 deletion.
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,11 @@ | ||
codecov: | ||
notify: | ||
after_n_builds: 9 | ||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70..100" | ||
status: | ||
project: | ||
default: | ||
threshold: "2%" |
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,48 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.test-env }} on ${{ matrix.container }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test-env: | ||
- prepro | ||
- numerics | ||
- models | ||
- benchmark | ||
- utils | ||
- vascaling | ||
- workflow-single | ||
- workflow-multi | ||
- graphics-mpl | ||
container: | ||
- oggm/untested_base:20200323 | ||
- oggm/untested_base:py36 | ||
include: | ||
- container: python:3.7-slim | ||
test-env: minimal | ||
runs-on: ubuntu-latest | ||
container: ${{ matrix.container }} | ||
continue-on-error: ${{ contains(matrix.container, 'py3') }} | ||
steps: | ||
- name: Install tools | ||
if: ${{ contains(matrix.container, 'slim') }} | ||
run: apt-get -y update && apt-get -y install git curl | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Test | ||
run: ./ci/run_tests.sh ${{ matrix.test-env }} | ||
- name: Upload Coverage | ||
if: ${{ !contains(matrix.container, 'py3') }} | ||
run: | | ||
curl -o codecov.sh --max-time 30 --retry 20 --retry-delay 30 --retry-max-time 600 https://codecov.io/bash | ||
bash codecov.sh -n "${{ matrix.test-env }} on ${{ matrix.container }}" |
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,41 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
chown -R "$(id -u):$(id -g)" "$HOME" | ||
|
||
export OGGM_TEST_ENV="$1" | ||
export OGGM_TEST_MODE=unset | ||
export MPLBACKEND=agg | ||
|
||
if [[ $OGGM_TEST_ENV == *-* ]]; then | ||
export OGGM_TEST_MODE="${OGGM_TEST_ENV/*-/}" | ||
export OGGM_TEST_ENV="${OGGM_TEST_ENV/-*/}" | ||
fi | ||
|
||
[[ $OGGM_TEST_MODE == single ]] && export OGGM_TEST_MULTIPROC=False | ||
[[ $OGGM_TEST_MODE == multi ]] && export OGGM_TEST_MULTIPROC=True | ||
[[ $OGGM_TEST_MODE == mpl ]] && export OGGM_MPL=--mpl | ||
|
||
if [[ $OGGM_TEST_ENV == minimal ]]; then | ||
# Special Mode for minimal tests on minimal Python-Image | ||
|
||
export PIP=pip3 | ||
$PIP install --upgrade pytest git+https://github.com/OGGM/pytest-mpl.git | ||
fi | ||
|
||
[[ -d .git ]] || export SETUPTOOLS_SCM_PRETEND_VERSION="g$GITHUB_SHA" | ||
|
||
$PIP install --upgrade coverage git+https://github.com/fmaussion/salem.git | ||
$PIP install -e . | ||
|
||
export COVERAGE_RCFILE="$PWD/.coveragerc" | ||
|
||
coverage erase | ||
|
||
coverage run --source=./oggm --parallel-mode --module \ | ||
pytest --verbose --mpl-upload $OGGM_MPL --run-slow --run-test-env $OGGM_TEST_ENV oggm | ||
|
||
coverage combine | ||
coverage xml | ||
coverage report --skip-covered |