Skip to content

Commit 5120bc5

Browse files
Merge pull request #12 from mariogeiger/main
Continuous Integration
2 parents ef607d1 + 22c0e29 commit 5120bc5

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install setuptools wheel twine
22+
- name: Build and publish
23+
env:
24+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
25+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check Syntax and Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6, 3.9]
19+
torch-version: [1.8.0, 1.10.0]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install flake8
28+
run: |
29+
pip install flake8
30+
- name: Lint with flake8
31+
run: |
32+
flake8 . --count --show-source --statistics
33+
- name: Install dependencies
34+
env:
35+
TORCH: "${{ matrix.torch-version }}"
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install wheel
40+
pip install torch==${TORCH} torchvision torchaudio -f https://download.pytorch.org/whl/cpu/torch_stable.html
41+
pip install .
42+
- name: Install pytest
43+
run: |
44+
pip install pytest
45+
- name: Test with pytest
46+
run: |
47+
pytest --doctest-modules --ignore=docs/ .

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 127
3+
select = E,F,W,C
4+
ignore = E226,E501,E741,E743,C901,W503
5+
exclude = .eggs,*.egg,build,dist,docs

0 commit comments

Comments
 (0)