-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 1.65 KB
/
Copy pathpython-package.yml
File metadata and controls
65 lines (62 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python --version
pip install flake8
- name: Run flake8
run: |
flake8 --per-file-ignores="__init__.py:F401" --max-line-length 88 dev_helper/
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Set up PostgreSQL client
run: |
echo "[test_pj_helper_database]" > .db.conf
echo "host=localhost" >> .db.conf
echo "port=5432" >> .db.conf
echo "user=test_user" >> .db.conf
echo "password=test_password" >> .db.conf
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install -e .
pip install -e .[tests]
pip install py
- name: Set up pytest path
run: echo "::add-path::$(python -m site --user-base)/bin"test
- name: Run tests
run: pytest tests/
- name: Upload .db.conf artifact
uses: actions/upload-artifact@v2
with:
name: db-config
path: .db.conf