-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (55 loc) · 2.94 KB
/
pytest-with-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
name: pytest-with-coverage
on:
push:
branches: ['*']
# Enable workflow to be triggered from GitHub CLI, browser, or via API
# primarily for testing conda env 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.12' ]
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Conda environment with Micromamba
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7
with:
environment-file: envs/environment-test.yaml
environment-name: salishsea-nowcast-test
# environment caching does not play nicely with --editable installed packages
cache-environment: false
cache-downloads: true
# persist downloads cache for 1 day
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ inputs.python-version }}
- name: Install editable-mode dependency packages
shell: bash -l {0}
run: |
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/43ravens/NEMO_Nowcast.git#egg=NEMO_Nowcast
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/UBC-MOAD/moad_tools#egg=moad_tools
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/UBC-MOAD/Reshapr#egg=Reshapr
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 --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/SalishSeaCast/SalishSeaCmd.git#egg=SalishSeaCmd
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable "git+https://github.com/SalishSeaCast/tools#egg=SalishSeaTools&subdirectory=SalishSeaTools"
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://github.com/SalishSeaCast/FVCOM-Cmd.git#egg=FVCOM-Cmd
# OPPTools is a private GitLab repo, so an access token is required
python3 -m pip install --src $GITHUB_WORKSPACE/../vcs_pkgs/ --editable git+https://oauth2:${{ secrets.GITLAB_ACCESS_TOKEN }}@gitlab.com/mdunphy/OPPTools.git@6c784a4dc44dd9030aafe9a8519e5ae0b6cc3183#egg=OPPTools
python3 -m pip install --editable $GITHUB_WORKSPACE
- name: pytest package with coverage
shell: bash -l {0}
run: |
pytest --cov=$GITHUB_WORKSPACE --cov-report=xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be
with:
file: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}