-
Notifications
You must be signed in to change notification settings - Fork 105
85 lines (83 loc) · 2.53 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
- workflow-single
- workflow-multi
- graphics-mpl
container:
- ghcr.io/oggm/untested_base:20231004
- ghcr.io/oggm/untested_base:py3.10
- ghcr.io/oggm/untested_base:py3.9
include:
- container: python:3.11-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@v4
- name: Fix Git-Permissions
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Test
run: ./ci/run_tests.sh "${{ matrix.test-env }}" "${{ matrix.container }}"
env:
STATIC_MAP_API_KEY: ${{ secrets.STATIC_MAP_API_KEY }}
- name: Normalize Artifact Name
id: sanitize-name
if: failure()
shell: bash
run: |
SANITIZED_NAME="pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }}"
SANITIZED_NAME="${SANITIZED_NAME//:/_}"
SANITIZED_NAME="${SANITIZED_NAME//\//_}"
SANITIZED_NAME="${SANITIZED_NAME//./_}"
echo "sanitized_name=${SANITIZED_NAME}" >> $GITHUB_OUTPUT
- name: Upload pytest-mpl artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: "${{ steps.sanitize-name.outputs.sanitized_name }}"
path: /tmp/oggm-mpl-results/
- name: Upload Coverage
if: ${{ !contains(matrix.container, 'py3') }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
COVERALLS_SERVICE_NAME: github
COVERALLS_PARALLEL: true
run: coveralls
finish-coveralls:
name: Coveralls Finished
needs: test
runs-on: ubuntu-latest
container: python:3.11-slim
continue-on-error: true
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ github.token }}
COVERALLS_SERVICE_NAME: github
run: |
pip3 install --upgrade coveralls &&
coveralls --finish