Skip to content

Commit

Permalink
Merge pull request #155 from hugovk/github-actions
Browse files Browse the repository at this point in the history
Replace Travis CI with GitHub Actions
  • Loading branch information
jezdez authored Nov 25, 2020
2 parents 6a29eb3 + 3bc2831 commit c097c4d
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 43 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
if: github.repository == 'jazzband/geojson'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: release-${{ hashFiles('**/setup.py') }}
restore-keys: |
release-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/geojson/upload
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', 'pypy3']

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade codecov
- name: Tests
run: |
coverage run --branch --source=geojson setup.py test
coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
geojson
==============

.. image:: https://img.shields.io/travis/jazzband/geojson.svg
:target: https://travis-ci.org/jazzband/geojson
:alt: Travis
.. image:: https://github.com/jazzband/geojson/workflows/Test/badge.svg
:target: https://github.com/jazzband/geojson/actions
:alt: GitHub Actions
.. image:: https://img.shields.io/codecov/c/github/jazzband/geojson.svg
:target: https://codecov.io/github/jazzband/geojson?branch=master
:alt: Codecov
Expand Down

0 comments on commit c097c4d

Please sign in to comment.