Skip to content

Commit 712722f

Browse files
committed
Switch CI to GitHub Actions
1 parent 1cc1d52 commit 712722f

File tree

3 files changed

+88
-110
lines changed

3 files changed

+88
-110
lines changed

.circleci/config.yml

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

.github/workflows/publish.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8, 3.9]
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- uses: actions/cache@v2
20+
name: Configure pip caching
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-
26+
- name: Install dependencies
27+
run: |
28+
pip install -e '.[test]'
29+
- name: Run tests
30+
run: |
31+
pytest
32+
deploy:
33+
runs-on: ubuntu-latest
34+
needs: [test]
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Set up Python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: '3.9'
41+
- uses: actions/cache@v2
42+
name: Configure pip caching
43+
with:
44+
path: ~/.cache/pip
45+
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
46+
restore-keys: |
47+
${{ runner.os }}-publish-pip-
48+
- name: Install dependencies
49+
run: |
50+
pip install setuptools wheel twine
51+
- name: Publish
52+
env:
53+
TWINE_USERNAME: __token__
54+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
55+
run: |
56+
python setup.py sdist bdist_wheel
57+
twine upload dist/*
58+

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.6, 3.7, 3.8, 3.9]
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+
- uses: actions/cache@v2
18+
name: Configure pip caching
19+
with:
20+
path: ~/.cache/pip
21+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
22+
restore-keys: |
23+
${{ runner.os }}-pip-
24+
- name: Install dependencies
25+
run: |
26+
pip install -e '.[test]'
27+
- name: Run tests
28+
run: |
29+
pytest
30+

0 commit comments

Comments
 (0)