Skip to content

Commit

Permalink
Merge 60b14f9 into d92b4ba
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Sep 29, 2020
2 parents d92b4ba + 60b14f9 commit 0ff62ca
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 74 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 }}
81 changes: 81 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Publish packages to PyPI

on:
push:
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:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2014_x86_64
- uses: actions/upload-artifact@v2
with:
name: linux-wheels
path: dist/*-manylinux*.whl

other-wheels:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
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 --binary .
- 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 .
- 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: Move the packages to dist/
run: |
mkdir dist
mv */*.whl */*.tar.gz dist
- name: Upload packages
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools >= 42",
"wheel >= 0.29.0",
"setuptools_scm[toml] >= 3.4"
]
build-backend = "setuptools.build_meta"
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 0ff62ca

Please sign in to comment.