-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (52 loc) · 1.77 KB
/
python-test.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: PHOTONAI_neuro tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
pytest:
name: Run PHOTONAI_neuro tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install wheel flake8
pip install pytest pytest-cov coveralls -r requirements.txt
- name: Test with pytest
run: |
PYTHONPATH=./ pytest ./test --cov-report lcov:./coverage/lcov.info --cov=./photonai_neuro --tb=long
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Build and publish to TestPyPI
runs-on: ubuntu-22.04
needs: pytest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: pip install build pbr wheel
- name: Build a binary wheel and a source tarball
run: python -m build --sdist -n --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/