-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #290 from peopledoc/github-actions
Add github actions
- Loading branch information
Showing
5 changed files
with
134 additions
and
84 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,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 }} |
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -37,4 +37,3 @@ suboptimal | |
sync | ||
th | ||
tox | ||
Travis |