Skip to content

Commit 3f44e82

Browse files
committed
chore: Start using Github Pipelines instead of Travis
1 parent d58d2d4 commit 3f44e82

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Run Tests & Deploy
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build-and-test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
10+
services:
11+
postgres:
12+
image: postgres
13+
env:
14+
POSTGRES_PASSWORD: postgres
15+
options: >-
16+
--health-cmd pg_isready
17+
--health-interval 10s
18+
--health-timeout 5s
19+
--health-retries 5
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip setuptools wheel
29+
pip install -e '.[tests]'
30+
- name: Install packages needed for CI
31+
run: pip install pre-commit
32+
- name: Lint all files
33+
run: pre-commit run --all-files --show-diff-on-failure
34+
- name: Run tests
35+
run: python setup.py test
36+
deploy:
37+
runs-on: ubuntu-latest
38+
needs: build-and-test
39+
if: github.ref == 'refs/heads/main'
40+
steps:
41+
- uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 0
44+
token: ${{ secrets.PUBLISH_TOKEN }}
45+
- name: Semantic release
46+
uses: relekang/python-semantic-release@master
47+
with:
48+
# Personal Access Token that belongs to an admin of the repo must
49+
# be set in PUBLISH_TOKEN secret to bypass `main` branch protection
50+
github_token: ${{ secrets.PUBLISH_TOKEN }}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
],
4141
tests_require=[
4242
"pytest",
43-
"pytest-postgresql==1.3.0",
43+
"pytest-postgresql",
4444
"pre-commit",
4545
],
4646
entry_points={

0 commit comments

Comments
 (0)