-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters