Skip to content

Commit dd26891

Browse files
committed
refactor(ci): switch to GitHub actions from GitLab CI
1 parent 895b17a commit dd26891

File tree

5 files changed

+107
-80
lines changed

5 files changed

+107
-80
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
on: release
3+
4+
jobs:
5+
build-n-publish:
6+
name: pypi
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- name: Set up Python 3.8
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: 3.8
14+
- name: Install setuptools
15+
run: >-
16+
python -m
17+
pip install
18+
setuptools
19+
--user
20+
- name: Install wheel
21+
run: >-
22+
python -m
23+
pip install
24+
wheel
25+
--user
26+
- name: Build a binary wheel
27+
run: >-
28+
python
29+
setup.py
30+
sdist
31+
bdist_wheel
32+
- name: Publish distribution 📦 to PyPI
33+
if: startsWith(github.event.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
user: __token__
37+
password: ${{ secrets.pypi_password }}
38+

.github/workflows/style.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Code analysis
2+
on: push
3+
4+
jobs:
5+
black:
6+
name: black
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- uses: docker://kiwicom/black:19.10b0
11+
with:
12+
entrypoint: black
13+
args: --check . --diff
14+
15+
pylint:
16+
name: pylint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@master
20+
- uses: docker://kiwicom/tox
21+
env:
22+
XDG_CACHE_HOME: /tmp/cache
23+
with:
24+
entrypoint: tox
25+
args: -e pylint

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
on: push
3+
4+
jobs:
5+
tests:
6+
name: pytest
7+
runs-on: ubuntu-latest
8+
services:
9+
postgres:
10+
image: postgres:alpine
11+
env:
12+
POSTGRES_PASSWORD: postgres
13+
options: >-
14+
--health-cmd pg_isready
15+
--health-interval 10s
16+
--health-timeout 5s
17+
--health-retries 5
18+
steps:
19+
- uses: actions/checkout@master
20+
- name: Setting up tox environment
21+
uses: docker://kiwicom/tox
22+
env:
23+
TOXENV: ${{ matrix.toxenv }}
24+
XDG_CACHE_HOME: /tmp/cache
25+
with:
26+
args: >
27+
sh -c
28+
"
29+
mkdir -p reports ;
30+
export DATABASE_URI=postgres://postgres:postgres@postgres:5432/postgres ;
31+
tox -e $TOXENV -- --junitxml=reports/$TOXENV/test_report.xml --cov kw --cov-report xml --cov-config .coveragerc --cov-append --cov-report xml:reports/coverage.xml
32+
"
33+
- name: Cache multiple paths
34+
uses: actions/cache@v2
35+
with:
36+
path: .tox
37+
key: ${{ runner.os }}-${{ hashFiles('*requirements.txt') }}
38+
strategy:
39+
matrix:
40+
toxenv: [py27, py27-enum, py35, py36, py36-simplejson, py37, py38]
41+

.gitlab-ci.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,36,37},py27_with_enum,py36_with_simplejson,black,pylint
2+
envlist = py{27,36,37},py27-enum,py36-simplejson,black,pylint
33

44
[testenv:coala]
55
deps = coala-bears==0.11.*
@@ -13,15 +13,15 @@ passenv =
1313
DATABASE_URI
1414
commands = pytest test {posargs:}
1515

16-
[testenv:py27_with_enum]
16+
[testenv:py27-enum]
1717
basepython = python2.7
1818
deps =
1919
-rtest-requirements.txt
2020
enum34==1.1.6
2121
skip_install = True
2222
commands = pytest test {posargs:}
2323

24-
[testenv:py36_with_simplejson]
24+
[testenv:py36-simplejson]
2525
basepython = python3.6
2626
deps =
2727
-rtest-requirements.txt

0 commit comments

Comments
 (0)