Skip to content

Commit 19342a2

Browse files
authored
Merge pull request NatLibFi#6 from NatLibFi/github-actions
GitHub actions
2 parents d380978 + 3bee31d commit 19342a2

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python package
2+
3+
on: [push, pull_request]
4+
jobs:
5+
test-job:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install
18+
run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install .[dev]
21+
- name: Test with pytest
22+
run: |
23+
pytest
24+
25+
build-and-publish-job:
26+
needs: test-job
27+
runs-on: ubuntu-20.04
28+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up Python 3.8
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: '3.8'
35+
- name: Build distribution
36+
run: |
37+
python -m pip install wheel
38+
python setup.py sdist bdist_wheel
39+
- name: Publish distribution
40+
uses: pypa/gh-action-pypi-publish@release/v1.4
41+
with:
42+
user: __token__
43+
password: ${{ secrets.PYPI_API_TOKEN }}

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)