Skip to content

Commit

Permalink
Created Github Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Sep 29, 2020
1 parent d92b4ba commit 5bdb47c
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/codeqa-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Python codeqa/test

on:
push:
branches: [master]
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-lint
- name: Install dependencies
run: pip install flake8
- name: Run flake8
run: flake8 cbor2 tests

test:
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, pypy3]
exclude:
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: pypy3
- os: windows-latest
python-version: 3.7
- os: windows-latest
python-version: pypy3 # https://github.com/python-trio/trio/issues/1361
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
- name: Install dependencies
run: pip install .[test] coveralls
- name: Test with pytest
run: coverage run -m pytest
- name: Upload Coverage
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true

coveralls:
name: Finish Coveralls
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip install coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Publish packages to PyPI

on:
push:
branches: [workflow]
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
linux_wheels:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, pypy3]
runs-on: ubuntu-latest
steps:
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2014_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38'
- uses: actions/upload-artifact@v2
with:
name: linux-wheels
path: dist/*.whl

other_wheels:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, pypy3]
exclude:
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: pypy3
- os: windows-latest
python-version: 3.7
- os: windows-latest
python-version: pypy3 # https://github.com/python-trio/trio/issues/1361
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
- name: Install dependencies
run: pip install pep517
- name: Create packages
run: python -m pep517.build --source --binary --out-dir dist/ .
- uses: actions/upload-artifact@v2
with:
name: other-wheels
path: dist/*.whl

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: pip install pep517
- name: Create sdist
run: python -m pep517.build --source --out-dir dist/ .
- uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz

publish:
needs:
- linux_wheels
- other_wheels
- sdist
runs-on: ubuntu-latest
steps:
- name: Download generated packaging artifacts
uses: actions/download-artifact@v2
- name: List packages
run: ls -l dist
# - name: Upload packages
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ testpaths = tests

[coverage:run]
source = cbor2
relative_files = true

[coverage:report]
show_missing = true
Expand Down

0 comments on commit 5bdb47c

Please sign in to comment.