-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (49 loc) · 1.37 KB
/
main.yml
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
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: xian
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.11.8
uses: actions/setup-python@v4
with:
python-version: '3.11.8'
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config libhdf5-dev build-essential
- name: Clone xian-contracting repository
run: git clone https://github.com/xian-network/xian-contracting.git
- name: Set up Python environment
run: python3.11 -m venv xian_venv
- name: Activate virtual environment and install dependencies
run: |
source xian_venv/bin/activate
pip install -e xian-contracting/ -e .
pip install pytest # Install pytest explicitly
- name: Run tests
env:
DATABASE_URL: postgres://postgres:1234@localhost:5432/xian
run: |
source xian_venv/bin/activate
pytest tests