Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Travis to GitHub Actions #78

Merged
merged 14 commits into from Feb 12, 2021
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,55 @@
name: build

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build:

strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9 ]
include:
- python-version: 3.5
os: ubuntu-latest
- python-version: 3.6
os: ubuntu-latest
- python-version: 3.7
os: ubuntu-latest
- python-version: 3.8
os: ubuntu-latest
- python-version: pypy3
os: ubuntu-latest

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 }}
- name: Install dependencies
run: |
python -m pip install virtualenv
python -m virtualenv venv
make install
- name: Run tests
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
nosetests --traverse-namespace
else
make test
make local
fi
shell: bash
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
uses: codecov/codecov-action@v1
with:
directory: ./_build/coverage
7 changes: 2 additions & 5 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -2,12 +2,9 @@ name: "CodeQL"

on:
push:
branches: [master, ]
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 19 * * 4'
branches: [ master ]

jobs:
analyse:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,30 @@
name: deploy

on:
workflow_run:
workflows: ["build"]
types:
- completed

jobs:
deploy:
name: Publish Python package on release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Prepare dist
run: |
make install
make local
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,7 +2,6 @@
*.iml
*.pyc
.coverage
coverage.xml
*.log
venv
dist/
Expand Down
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

8 changes: 1 addition & 7 deletions Makefile
Expand Up @@ -28,13 +28,7 @@ clean: nopyc
test: install
@( \
source venv/bin/activate; \
python `which nosetests` --with-coverage --cover-erase --cover-package=. --cover-html --cover-html-dir=_build/coverage; \
)

test-race:
@( \
source venv/bin/activate; \
for i in {1..$(RACE_ITERATIONS)}; do python `which nosetests` || break; done; \
python `which nosetests` --with-coverage --cover-erase --cover-package=. --cover-xml --cover-xml-file=_build/coverage/coverage.xml --cover-html --cover-html-dir=_build/coverage; \
)

docs: install
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
<p align="center"><img alt="pyngrok - a Python wrapper for ngrok" src="https://pyngrok.readthedocs.io/en/latest/_images/logo.png" /></p>

[![PyPI version](https://badge.fury.io/py/pyngrok.svg)](https://badge.fury.io/py/pyngrok)
[![Build Status](https://travis-ci.com/alexdlaird/pyngrok.svg?branch=master)](https://travis-ci.com/alexdlaird/pyngrok)
[![build](https://github.com/alexdlaird/pyngrok/workflows/build/badge.svg)](https://github.com/alexdlaird/pyngrok/actions?query=workflow%3Abuild)
[![codecov](https://codecov.io/gh/alexdlaird/pyngrok/branch/master/graph/badge.svg)](https://codecov.io/gh/alexdlaird/pyngrok)
[![Documentation Status](https://readthedocs.org/projects/pyngrok/badge/?version=latest)](https://pyngrok.readthedocs.io/en/latest/?badge=latest)
[![image](https://img.shields.io/pypi/pyversions/pyngrok.svg)](https://pypi.org/project/pyngrok/)
Expand Down