Skip to content

Commit

Permalink
Replaced Travis with Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Feb 16, 2021
1 parent 16fa163 commit f2a6c8f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 64 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/codeqa-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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 src tests

test:
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10.0-alpha.5, pypy3]
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 --service=github
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 --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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:
publish:
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 build
- name: Create packages
run: python -m build -s -w .
- name: Upload packages
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

0 comments on commit f2a6c8f

Please sign in to comment.