-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (95 loc) · 2.52 KB
/
Copy pathtest.yml
File metadata and controls
110 lines (95 loc) · 2.52 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Test
on:
push:
branches-ignore:
- main
- staging
- develop
pull_request:
branches:
- main
- staging
- develop
env:
POSTGRES_USER: ipno
POSTGRES_DB: ipno
POSTGRES_PASSWORD: password
POSTGRES_HOST: localhost
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.7
env:
POSTGRES_USER: ipno
POSTGRES_DB: ipno
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: elasticsearch:7.10.1
env:
discovery.type: single-node
ports:
- 9200:9200
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
redis:
image: redis:7.0.5
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'
- name: Install native packages
run: |
sudo apt-get update
sudo apt-get -y install ghostscript python3-wand
- name: Install dependencies
run: |
pip install "pip<24.1"
pip install -r requirements/dev.txt
- name: Install spacy model
run: |
python -m spacy download en_core_web_sm
- name: Lint
run: bin/lint.sh
- name: Run tests
env:
IPNO_API_KEY: ${{ secrets.IPNO_API_KEY }}
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
ELASTICSEARCH_HOST: localhost:9200
CELERY_BROKER_URL: redis://localhost:6379
run: |
mkdir -p test-results
python -m pytest --cov-report term --cov=ipno ipno --junitxml=test-results/junit.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: python -m coveralls
continue-on-error: true