Skip to content

Commit f537765

Browse files
author
Hugo Osvaldo Barrera
committed
Run CI with Github Actions
1 parent f81762a commit f537765

4 files changed

Lines changed: 86 additions & 3 deletions

File tree

.github/workflows/checks.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Checks
2+
3+
on: [push]
4+
5+
jobs:
6+
styles:
7+
runs-on: ubuntu-18.04
8+
name: Linting
9+
steps:
10+
- uses: actions/checkout@master
11+
- uses: actions/setup-python@v1
12+
with:
13+
python-version: 3.7
14+
architecture: x64
15+
- name: Install test dependencies
16+
run: pip install --upgrade --no-cache-dir flake8 flake8-bugbear flake8-comprehensions flake8-import-order
17+
- name: Run flake8
18+
run: flake8

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
github-release:
10+
runs-on: ubuntu-18.04
11+
name: Publish GitHub Release
12+
steps:
13+
- uses: actions/checkout@master
14+
- uses: actions/setup-python@v1
15+
with:
16+
python-version: 3.7
17+
architecture: x64
18+
- name: Install build dependencies
19+
run: pip install wheel
20+
- name: Build packages
21+
run: python setup.py sdist bdist_wheel
22+
- name: Release
23+
uses: softprops/action-gh-release@v1
24+
with:
25+
files: dist/*
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
pypi:
29+
runs-on: ubuntu-18.04
30+
name: Publish package on PyPI
31+
steps:
32+
- uses: actions/checkout@master
33+
- uses: actions/setup-python@v1
34+
with:
35+
python-version: 3.7
36+
architecture: x64
37+
- name: Install build dependencies
38+
run: pip install wheel
39+
- name: Build packages
40+
run: python setup.py sdist bdist_wheel
41+
- name: Publish a Python distribution to PyPI
42+
uses: pypa/gh-action-pypi-publish@master
43+
with:
44+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-18.04, macOS-10.14]
11+
python: [ '3.5', '3.6', '3.7' ]
12+
name: python${{ matrix.python }} on ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@master
15+
- uses: actions/setup-python@v1
16+
with:
17+
python-version: ${{ matrix.python }}
18+
architecture: x64
19+
- name: Install test dependencies
20+
run: |
21+
pip install --upgrade --no-cache-dir pipenv
22+
pipenv install --dev
23+
- name: Run tests
24+
run: pipenv run pytest

Pipfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ pytest-cov = "*"
99

1010
[packages]
1111
python-barcode = {editable = true,path = "."}
12-
13-
[requires]
14-
python_version = "3.7"

0 commit comments

Comments
 (0)