Skip to content

Commit 0dfb2ea

Browse files
committed
added github actions
1 parent e354cda commit 0dfb2ea

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload to PyPI
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Unset header
18+
# checkout@v2 adds a header that makes branch protection report errors
19+
# because the Github action bot is not a collaborator on the repo
20+
run: git config --local --unset http.https://github.com/.extraheader
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.x'
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install twine build
29+
30+
- name: Build and publish
31+
env:
32+
TWINE_USERNAME: __token__
33+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
34+
run: |
35+
python -m build
36+
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
python-version: ["3.7", "3.11"]
20+
fail-fast: false
21+
runs-on: ${{ matrix.os }}
22+
defaults:
23+
run:
24+
shell: bash -l {0}
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Disable etelemetry
28+
run: echo "NO_ET=TRUE" >> $GITHUB_ENV
29+
30+
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Update build tools
36+
run: python -m pip install --upgrade pip
37+
38+
- name: Install Package
39+
run: python -m pip install -e .
40+
41+
- name: Pytest
42+
run: pytest -vvs --cov nipype2pydra --cov-config .coveragerc --cov-report xml
43+
44+
- name: Upload coverage to Codecov
45+
uses: codecov/codecov-action@v2
46+
with:
47+
fail_ci_if_error: true
48+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)