Skip to content

Commit bf69ed1

Browse files
committed
Add github actions
- Static Analysis & Test - PyPi release
1 parent f539d39 commit bf69ed1

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
jobs:
6+
7+
build-and-publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.x"
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install --upgrade setuptools wheel twine
25+
- name: Build wheel
26+
run: |
27+
python setup.py build bdist_wheel
28+
- name: Publish to PyPI
29+
env:
30+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32+
run: |
33+
twine upload --verbose dist/*
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Static Analysis & Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
static-analysis:
8+
9+
# We want to run on external PRs, but not on our own internal PRs as they'll
10+
# be run by the push to the branch. Without this if check, checks are
11+
# duplicated since internal PRs match both the push and pull_request events.
12+
# https://github.com/psf/black/blob/f51e53726b39a177355a7917c91c56f390dda7ef/.github/workflows/lint.yml#L7-L12
13+
if:
14+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
15+
github.repository
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: "3.x"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install tox
32+
33+
- name: Lint with flake8
34+
run: tox -e flake8
35+
36+
- name: Format with black
37+
run: tox -e black
38+
39+
40+
# test:
41+
42+
# # We want to run on external PRs, but not on our own internal PRs as they'll
43+
# # be run by the push to the branch. Without this if check, checks are
44+
# # duplicated since internal PRs match both the push and pull_request events.
45+
# if:
46+
# github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
47+
# github.repository
48+
49+
# runs-on: ubuntu-latest
50+
51+
# strategy:
52+
# matrix:
53+
# python: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
54+
55+
# steps:
56+
# - name: Checkout code
57+
# uses: actions/checkout@v2
58+
59+
# - name: Setup Python
60+
# uses: actions/setup-python@v2
61+
# with:
62+
# python-version: ${{ matrix.python }}
63+
64+
# - name: Install dependencies
65+
# run: |
66+
# python -m pip install --upgrade pip
67+
# python -m pip install tox
68+
69+
# - name: Run Tox
70+
# run: |
71+
# tox -e py

0 commit comments

Comments
 (0)