Skip to content

Commit

Permalink
pglookout: migrate from travis CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jankatins committed Sep 14, 2021
1 parent 2d7c246 commit d4396ea
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 24 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build pglookout

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

jobs:

lint:
runs-on: ubuntu-latest
strategy:
matrix:
# only use the newest version for the lint step -> as long as the other version can run it it's ok
python-version: [3.9]

steps:

- id: checkout-code
uses: actions/checkout@v2

- id: prepare-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- id: dependencies
run: |
pip install -e .
pip install --upgrade pylint flake8 pytest mock
- id: pylint
run: make pylint

- id: flake8
run: make flake8

test:
runs-on: ubuntu-latest
needs: lint
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
pg-version: [9.6, 10, 11, 12, 13]

steps:
- id: checkout-code
uses: actions/checkout@v2

- id: prepare-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- id: dependencies
run: |
# Setup the Postgres repositories
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
# Setup build deps
sudo apt-get install -y libsnappy-dev
sudo apt-get install -y postgresql-${{ matrix.pg-version }}
# Setup common python dependencies
python -m pip install --upgrade pip
pip install --upgrade pytest mock
pip install -e .
- id: unittest
run: make unittest
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ disable=
too-many-public-methods,
too-many-statements,
ungrouped-imports,
wrong-import-order
wrong-import-order,
unspecified-encoding

[REPORTS]
output-format=text
Expand Down
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ flake8: $(generated)
$(PYTHON) -m flake8 --ignore E722 --max-line-len=125 $(PYLINT_DIRS)

pylint: $(generated)
$(PYLINT) --rcfile .pylintrc $(PYLINT_DIRS)
$(PYTHON) -m pylint --rcfile .pylintrc $(PYLINT_DIRS)

coverage:
$(PYTHON) -m pytest $(PYTEST_ARG) --cov-report term-missing --cov pglookout test/
Expand Down

0 comments on commit d4396ea

Please sign in to comment.