This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.83 KB
/
pytest-coverage.yaml
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
name: CI
on:
push:
branches: ['*']
jobs:
test-coverage:
name: pytest & coverage report
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Cache conda pkgs
uses: actions/cache@v1
env:
# Increase this value to reset cache if envs/environment-test.yaml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('envs/environment-test.yaml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
environment-file: envs/environment-test.yaml
python-version: ${{ matrix.python-version }}
activate-environment: mohid-cmd-test
- name: Install packages
shell: bash -l {0}
run: |
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/SalishSeaCast/NEMO-Cmd.git#egg=NEMO-Cmd
python3 -m pip install --editable $GITHUB_WORKSPACE
- name: pytest package with coverage
shell: bash -l {0}
run: |
pytest --cov=$GITHUB_WORKSPACE --cov-report=xml
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Python ${{ matrix.python-version }} pytest & coverage report
fields: repo,eventName,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
if: always()