Skip to content

Commit 98155c4

Browse files
committed
try github actions
1 parent 5341447 commit 98155c4

File tree

3 files changed

+74
-33
lines changed

3 files changed

+74
-33
lines changed

.github/workflows/tests.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Python package
2+
3+
on: [push]
4+
5+
jobs:
6+
postgres:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.7, 3.8, 3.9]
11+
postgres-version: [9, 10, 11, 12, 13]
12+
13+
# Service containers to run with `container-job`
14+
services:
15+
# Label used to access the service container
16+
postgres:
17+
# Docker Hub image
18+
image: postgres:${{ matrix.postgres-version }}
19+
# Provide the password for postgres
20+
env:
21+
POSTGRES_PASSWORD: postgres
22+
# Set health checks to wait until postgres has started
23+
options: >-
24+
--health-cmd pg_isready
25+
--health-interval 10s
26+
--health-timeout 5s
27+
--health-retries 5
28+
ports:
29+
- 5432:5432
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
pip install -r tests/test-requirements.txt
42+
- name: Setup postgres
43+
run: |
44+
psql -h postgres -c 'CREATE DATABASE piccolo;' -U postgres
45+
psql -h postgres -c "CREATE USER piccolo PASSWORD 'piccolo';" -U postgres
46+
psql -h postgres -c "GRANT ALL PRIVILEGES ON DATABASE piccolo TO piccolo;" -U postgres
47+
psql -h postgres -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" -d piccolo -U postgres
48+
49+
- name: Test with pytest, Postgres
50+
run: cd tests && ./test-postgres.sh
51+
env:
52+
PG_HOST: localhost
53+
PG_DATABASE: postgres
54+
PG_PASSWORD: postgres
55+
56+
sqlite:
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
python-version: [3.7, 3.8, 3.9]
61+
62+
steps:
63+
- uses: actions/checkout@v2
64+
- name: Set up Python ${{ matrix.python-version }}
65+
uses: actions/setup-python@v2
66+
with:
67+
python-version: ${{ matrix.python-version }}
68+
- name: Install dependencies
69+
run: |
70+
python -m pip install --upgrade pip
71+
pip install -r requirements.txt
72+
pip install -r tests/test-requirements.txt
73+
- name: Test with pytest, SQLite
74+
run: cd tests && ./test-sqlite.sh

.travis.yml

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

tests/travis.sh

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

0 commit comments

Comments
 (0)