Skip to content

Commit

Permalink
Merge pull request #290 from peopledoc/github-actions
Browse files Browse the repository at this point in the history
Add github actions
  • Loading branch information
thomasperrot authored Aug 25, 2020
2 parents a54c76c + 62f4824 commit db1a87c
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 84 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: CI

on:
push:
branches:
- master
tags:
- '*'
pull_request:

jobs:
lint:
name: Check lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
set -xeu
python -VV
pip install tox
- name: Check lint
run: tox -e check-lint

tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: procrastinate
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
ports:
- 5432:5432

strategy:
matrix:
include:
- python-version: 3.6
tox-env: py36-tests
- python-version: 3.7
tox-env: py37-tests
- python-version: 3.8
tox-env: py38-tests

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
set -xeu
python -VV
pip install tox coverage
- name: Run tox targets for ${{ matrix.python-version }}
run: tox -e ${{ matrix.tox-env }}
env:
PGDATABASE: procrastinate
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: password
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true

docs:
name: Build doc
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: |
set -xeu
python -VV
pip install tox
- name: Build doc
run: tox -e docs

deploy:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- lint
- tests
- docs
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
set -xeu
python -VV
pip install setuptools wheel
- name: Build the wheel
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-actions-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ relevant edits to the changelog, (see ``TODO``) including listing the migrations
for the release. Click on Release, that's it, the rest is automated.

When creating the release, GitHub will save the release info and create a tag with
the provided version. The new tag will be seen by Travis, which will then create a
wheel (using the tag as version number, thanks to our ``setup.py``), and push it
to PyPI (using the new API tokens). That tag should also trigger a ReadTheDocs
the provided version. The new tag will be seen by Github Actions, which will then
create a wheel (using the tag as version number, thanks to our ``setup.py``), and push
it to PyPI (using the new API tokens). That tag should also trigger a ReadTheDocs
build, which will read GitHub releases (thanks to our ``changelog`` extension)
which will write the changelog in the published documentation (transformed from
``Markdown`` to ``RestructuredText``).
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Procrastinate: PostgreSQL-based Task Queue for Python
:target: http://procrastinate.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://travis-ci.org/peopledoc/procrastinate.svg?branch=master
:target: https://travis-ci.org/peopledoc/procrastinate
.. image:: https://github.com/peopledoc/procrastinate/workflows/CI/badge.svg?branch=master
:target: https://github.com/peopledoc/procrastinate/actions?workflow=CI
:alt: Continuous Integration Status

.. image:: https://codecov.io/gh/peopledoc/procrastinate/branch/master/graph/badge.svg
Expand Down
1 change: 0 additions & 1 deletion docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ suboptimal
sync
th
tox
Travis

0 comments on commit db1a87c

Please sign in to comment.