-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (71 loc) · 2.92 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
name: Full Tests
on:
pull_request:
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
assess-file-changes:
uses: ./.github/workflows/assess-file-changes.yml
detect-changelog-updates:
needs: assess-file-changes
if: ${{ needs.assess-file-changes.outputs.SOURCE_CHANGED == 'true' }}
name: Auto-detecting CHANGELOG.md updates
runs-on: ubuntu-latest
steps:
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'true' }}
run: echo "CHANGELOG.md has been updated."
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'false' }}
run: |
echo "CHANGELOG.md has not been updated."
0
run:
name: Full tests on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] # macos-13 is the latest version of macOS with Intel chip
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Global Setup
run: |
pip install -U pip
pip install pytest-xdist
git config --global user.email "CI@example.com"
git config --global user.name "CI Almighty"
pip install wheel==0.41.2 # needed for scanimage
- name: Install roiextractors with minimal requirements
run: pip install .[test]
- name: Run minimal tests
run: pytest tests/test_internals -n auto --dist loadscope
- name: Test full installation (-e needed for codecov report)
run: pip install -e .[full]
- name: Get ophys_testing_data current head hash
id: ophys
run: echo "::set-output name=HASH_OPHYS_DATASET::$(git ls-remote https://gin.g-node.org/CatalystNeuro/ophys_testing_data.git HEAD | cut -f1)"
- name: Cache ophys dataset - ${{ steps.ophys.outputs.HASH_OPHYS_DATASET }}
uses: actions/cache@v2
id: cache-ophys-datasets
with:
path: ./ophys_testing_data
key: ophys-datasets-042023-${{ matrix.os }}-${{ steps.ophys.outputs.HASH_OPHYS_DATASET }}
- name: Run full pytest with coverage
run: pytest -n auto --dist loadscope --cov=./ --cov-report xml:./codecov.xml
- if: ${{ matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'}}
name: Upload full coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./codecov.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml