@@ -18,91 +18,131 @@ jobs:
1818 build :
1919 runs-on : ubuntu-latest
2020 steps :
21- - uses : actions/checkout@v4
21+ - name : Checkout repo
22+ uses : actions/checkout@v4
2223 with :
2324 fetch-depth : 0
24- - uses : actions/setup-python@v5
25+
26+ - name : Set up Python
27+ uses : actions/setup-python@v5
2528 with :
2629 python-version : 3
27- - run : pip install --upgrade build twine
30+
2831 - name : Build sdist and wheel
29- run : python -m build
30- - run : twine check dist/*
32+ run : |
33+ pip install --upgrade build twine
34+ python -m build
35+ twine check dist/*
36+
3137 - name : Upload sdist and wheel artifacts
3238 uses : actions/upload-artifact@v4
3339 with :
3440 name : dist
3541 path : dist/
42+
3643 - name : Build git archive
3744 run : mkdir archive && git archive -v -o archive/archive.tgz HEAD
45+
3846 - name : Upload git archive artifact
3947 uses : actions/upload-artifact@v4
4048 with :
4149 name : archive
4250 path : archive/
51+
52+ - name : Download test data
53+ env :
54+ BOX_USERNAME : ${{ secrets.BOX_USERNAME }}
55+ BOX_PASSWORD : ${{ secrets.BOX_PASSWORD }}
56+ run : |
57+ python tests/download_test_data.py
58+ tree tests/test_data
59+
60+ - name : Upload test data artifact
61+ uses : actions/upload-artifact@v4
62+ with :
63+ name : test_data
64+ path : tests/test_data/downloaded
65+
4366 test-package :
4467 runs-on : ubuntu-latest
4568 needs : [build]
4669 strategy :
4770 matrix :
4871 package : ['wheel', 'sdist', 'archive', 'editable']
4972 steps :
73+ - name : Checkout repo
74+ # Used to access the tests. Only install from source if matrix.package == 'editable'.
75+ uses : actions/checkout@v4
76+ with :
77+ fetch-depth : 0
78+
5079 - name : Download sdist and wheel artifacts
51- if : matrix.package != 'archive '
80+ if : matrix.package == 'wheel' || matrix.package == 'sdist '
5281 uses : actions/download-artifact@v4
5382 with :
5483 name : dist
5584 path : dist/
85+
5686 - name : Download git archive artifact
5787 if : matrix.package == 'archive'
5888 uses : actions/download-artifact@v4
5989 with :
6090 name : archive
6191 path : archive/
62- - name : Checkout repo
63- if : matrix.package == 'editable'
64- uses : actions/checkout@v4
65- with :
66- fetch-depth : 0
67- - uses : actions/setup-python@v5
92+
93+ - name : Set up Python
94+ uses : actions/setup-python@v5
6895 with :
6996 python-version : " 3.12"
97+
7098 - name : Display Python version
7199 run : python -c "import sys; print(sys.version)"
100+
72101 - name : Update pip
73102 run : pip install --upgrade pip
103+
74104 - name : Install wheel
75105 if : matrix.package == 'wheel'
76106 run : pip install dist/*.whl
107+
77108 - name : Install sdist
78109 if : matrix.package == 'sdist'
79110 run : pip install dist/*.tar.gz
111+
80112 - name : Install archive
81113 if : matrix.package == 'archive'
82114 run : pip install archive/archive.tgz
115+
83116 - name : Install editable
84117 if : matrix.package == 'editable'
85118 run : pip install -e .
86- - name : Install test extras
87- run : pip install .[test]
88- - name : Download test data
89- env :
90- BOX_USERNAME : ${{ secrets.BOX_USERNAME }}
91- BOX_PASSWORD : ${{ secrets.BOX_PASSWORD }}
92- run : |
93- python tests/download_test_data.py
94- tree tests/test_data
119+
120+ - name : Download test data artifact
121+ uses : actions/download-artifact@v4
122+ with :
123+ name : test_data
124+ path : tests/test_data/downloaded
125+
95126 - name : Run tests without coverage
96127 if : matrix.package != 'editable'
97- run : pytest -v jdb_to_nwb
128+ run : |
129+ pip install pytest
130+ pip list
131+ pytest -v
132+
98133 - name : Run tests on editable install with coverage
99134 if : matrix.package == 'editable'
100- run : pytest --cov=src --cov-report=xml -v jdb_to_nwb
135+ run : |
136+ pip install pytest-cov
137+ pip list
138+ pytest --cov=src --cov-report=xml --cov-report=term -v
139+
101140 - name : Upload coverage reports to Codecov
102141 if : matrix.package == 'editable'
103142 uses : codecov/codecov-action@v5
104143 env :
105144 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
145+
106146 # pypi-publish:
107147 # name: Upload release to PyPI
108148 # runs-on: ubuntu-latest
@@ -119,4 +159,4 @@ jobs:
119159 # name: dist
120160 # path: dist/
121161 # - name: Publish package distributions to PyPI
122- # uses: pypa/gh-action-pypi-publish@release/v1
162+ # uses: pypa/gh-action-pypi-publish@release/v1
0 commit comments