-
Notifications
You must be signed in to change notification settings - Fork 7
105 lines (87 loc) · 2.68 KB
/
Copy pathtest.yml
File metadata and controls
105 lines (87 loc) · 2.68 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
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-bookworm
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
opensearch:
image: opensearchproject/opensearch:2.13.0
env:
discovery.type: single-node
plugins.security.disabled: true
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "DevOnly-pass43431"
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=50s"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 9200:9200
steps:
- uses: actions/checkout@v3
- name: Create DB
run: PGPASSWORD=postgres createdb -h localhost -p 5432 -U postgres dataroom
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 22.14.0
cache: "npm"
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libsnappy-dev libcurl4-openssl-dev libssl-dev
- name: Install Node dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.13.0
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install -U poetry
- name: Install Python dependencies
run: poetry install --with dev
- name: Collect static
run: |
source .venv/bin/activate
python manage.py collectstatic -l --noinput --settings=backend.config.settings.test
- name: Check for missing migrations
run: |
source .venv/bin/activate
python manage.py makemigrations --check --dry-run --settings=backend.config.settings.test
- name: Setup opensearch
run: |
source .venv/bin/activate
python manage.py setup_opensearch --confirm --settings=backend.config.settings.test
- name: Run tests
run: |
source .venv/bin/activate
python -m pytest --junit-xml=.test_report.xml
shell: bash
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/dataroom
- uses: test-summary/action@v2
with:
paths: .test_report.xml
if: always()