Skip to content

Commit faedd68

Browse files
committed
Switch to GH actions for CI
1 parent a514a6b commit faedd68

2 files changed

Lines changed: 89 additions & 81 deletions

File tree

.github/workflows/main.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
- "develop"
8+
tags:
9+
- "*"
10+
pull_request:
11+
branches:
12+
- "develop"
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
env:
17+
# needed by coveralls
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
jobs:
21+
build_sdist:
22+
name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: [ubuntu-latest, windows-latest, macos-latest]
28+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: '0'
34+
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions\setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Install dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install -U wheel
44+
pip install -r requirements_setup.txt
45+
pip install -r requirements.txt
46+
pip install -r requirements_test.txt
47+
pip install coveralls>=3.0.0
48+
49+
- name: Build sdist
50+
run: |
51+
python setup.py sdist --formats=gztar bdist_wheel -d dist
52+
53+
- name: Run tests
54+
run: |
55+
python -m pytest --cov anaflow --cov-report term-missing -v tests/
56+
python -m coveralls --service=github
57+
58+
- uses: actions/upload-artifact@v2
59+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
60+
with:
61+
path: dist
62+
63+
upload_to_pypi:
64+
needs: [build_sdist]
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- uses: actions/download-artifact@v2
69+
with:
70+
name: artifact
71+
path: dist
72+
73+
- name: Publish to Test PyPI
74+
# only if working on develop
75+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
76+
uses: pypa/gh-action-pypi-publish@master
77+
with:
78+
user: __token__
79+
password: ${{ secrets.test_pypi_password }}
80+
repository_url: https://test.pypi.org/legacy/
81+
skip_existing: true
82+
83+
- name: Publish to PyPI
84+
# only if tagged
85+
if: startsWith(github.ref, 'refs/tags')
86+
uses: pypa/gh-action-pypi-publish@master
87+
with:
88+
user: __token__
89+
password: ${{ secrets.pypi_password }}

.travis.yml

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

0 commit comments

Comments
 (0)