-
Notifications
You must be signed in to change notification settings - Fork 29
135 lines (121 loc) · 4.31 KB
/
Copy pathrun_coverage.yml
File metadata and controls
135 lines (121 loc) · 4.31 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Run code coverage
on:
push:
branches:
- dev
tags-ignore: # exclude tags created by "ci_addons publish_github_release"
- 'latest'
- 'latest-tmp'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
run-coverage:
name: ${{ matrix.os }}, opt reqs ${{ matrix.opt_req }}
runs-on: ${{ matrix.os }}
# TODO handle forks
# run pipeline on either a push event or a PR event on a fork
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.opt_req }}
cancel-in-progress: true
strategy:
matrix:
include:
- { os: ubuntu-latest , opt_req: true }
- { os: ubuntu-latest , opt_req: false }
- { os: windows-latest, opt_req: false }
- { os: macos-latest , opt_req: false }
env: # used by codecov-action
OS: ${{ matrix.os }}
PYTHON: '3.14'
steps:
- name: Checkout repo with submodules
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
submodules: 'recursive'
fetch-depth: 0 # tags are required to determine the version
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON }}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install package
if: ${{ ! matrix.opt_req }}
run: |
python -m pip install --group test .
- name: Install package with optional dependencies
if: ${{ matrix.opt_req }}
run: |
python -m pip install --group test ".[tqdm,sparse,zarr,termset]"
- name: Run tests and generate coverage report
run: |
# coverage is configured in pyproject.toml
# codecov uploader requires xml format
python -m pip list
pytest --cov --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
# immutable release (see .github/zizmor.yml for the policy exception)
uses: codecov/codecov-action@v7.0.0
with:
fail_ci_if_error: true
files: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run-ros3-coverage:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0} # necessary for conda
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- { name: linux-python3.14-ros3 , python-ver: "3.14", os: ubuntu-latest }
steps:
- name: Checkout repo with submodules
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
submodules: 'recursive'
fetch-depth: 0 # tags are required to determine the version
- name: Set up Conda
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
auto-update-conda: true
activate-environment: ros3
environment-file: environment-ros3.yml
python-version: ${{ matrix.python-ver }}
channels: conda-forge
auto-activate: false
- name: Install run dependencies
run: |
python -m pip install .
python -m pip list
- name: Conda reporting
run: |
conda info
conda config --show-sources
conda list --show-channel-urls
- name: Run ros3 tests # TODO include gallery tests after they are written
run: |
python -m pytest --cov --cov-report=xml --cov-report=term tests/unit/test_io_hdf5_streaming.py
- name: Upload coverage to Codecov
# immutable release (see .github/zizmor.yml for the policy exception)
uses: codecov/codecov-action@v7.0.0
with:
fail_ci_if_error: true
files: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}