3737 permissions :
3838 checks : write
3939 services :
40- postgres :
40+ elasticsearch8 : &ES8_SERVICE
41+ image : elasticsearch:8.19.14
42+ ports :
43+ - 9202:9200
44+ env :
45+ discovery.type : single-node
46+ xpack.security.enabled : false
47+ options : >-
48+ --health-cmd "curl -sf http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=30s"
49+ --health-interval 10s
50+ --health-timeout 30s
51+ --health-retries 5
52+ postgres : &POSTGRES_SERVICE
4153 image : postgres
4254 env :
4355 POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
5466 - uses : ./.github/actions/start-build
5567 - name : Run tests
5668 run : poetry run python3 -m invoke test-ci-addons --junit
69+ env :
70+ ELASTIC8_URI : http://localhost:9202
5771 - name : Upload report
5872 if : (success() || failure()) # run this step even if previous step failed
5973 uses : ./.github/actions/gen-report
6478 permissions :
6579 checks : write
6680 services :
67- postgres :
68- image : postgres
69- env :
70- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
71- options : >-
72- --health-cmd pg_isready
73- --health-interval 10s
74- --health-timeout 5s
75- --health-retries 5
76- ports :
77- # Maps tcp port 5432 on service container to the host
78- - 5432:5432
81+ postgres : *POSTGRES_SERVICE
7982 steps :
8083 - uses : actions/checkout@v2
8184 - uses : ./.github/actions/start-build
@@ -91,25 +94,17 @@ jobs:
9194 permissions :
9295 checks : write
9396 services :
94- postgres :
95- image : postgres
96- env :
97- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
98- options : >-
99- --health-cmd pg_isready
100- --health-interval 10s
101- --health-timeout 5s
102- --health-retries 5
103- ports :
104- # Maps tcp port 5432 on service container to the host
105- - 5432:5432
97+ elasticsearch8 : *ES8_SERVICE
98+ postgres : *POSTGRES_SERVICE
10699 steps :
107100 - uses : actions/checkout@v2
108101 - uses : ./.github/actions/start-build
109102 - name : NVM & yarn install
110103 run : poetry run python3 -m invoke assets --dev
111104 - name : Run test
112105 run : poetry run python3 -m invoke test-ci-api1-and-js --junit
106+ env :
107+ ELASTIC8_URI : http://localhost:9202
113108 - name : Upload report
114109 if : (success() || failure()) # run this step even if previous step failed
115110 uses : ./.github/actions/gen-report
@@ -120,23 +115,15 @@ jobs:
120115 permissions :
121116 checks : write
122117 services :
123- postgres :
124- image : postgres
125- env :
126- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
127- options : >-
128- --health-cmd pg_isready
129- --health-interval 10s
130- --health-timeout 5s
131- --health-retries 5
132- ports :
133- # Maps tcp port 5432 on service container to the host
134- - 5432:5432
118+ elasticsearch8 : *ES8_SERVICE
119+ postgres : *POSTGRES_SERVICE
135120 steps :
136121 - uses : actions/checkout@v2
137122 - uses : ./.github/actions/start-build
138123 - name : Run tests
139124 run : poetry run python3 -m invoke test-ci-api2 --junit
125+ env :
126+ ELASTIC8_URI : http://localhost:9202
140127 - name : Upload report
141128 if : (success() || failure()) # run this step even if previous step failed
142129 uses : ./.github/actions/gen-report
@@ -147,19 +134,7 @@ jobs:
147134 checks : write
148135 needs : build-cache
149136 services :
150- postgres :
151- image : postgres
152-
153- env :
154- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
155- options : >-
156- --health-cmd pg_isready
157- --health-interval 10s
158- --health-timeout 5s
159- --health-retries 5
160- ports :
161- # Maps tcp port 5432 on service container to the host
162- - 5432:5432
137+ postgres : *POSTGRES_SERVICE
163138 steps :
164139 - uses : actions/checkout@v2
165140 - uses : ./.github/actions/start-build
@@ -175,19 +150,7 @@ jobs:
175150 checks : write
176151 needs : build-cache
177152 services :
178- postgres :
179- image : postgres
180-
181- env :
182- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
183- options : >-
184- --health-cmd pg_isready
185- --health-interval 10s
186- --health-timeout 5s
187- --health-retries 5
188- ports :
189- # Maps tcp port 5432 on service container to the host
190- - 5432:5432
153+ postgres : *POSTGRES_SERVICE
191154 mailhog :
192155 image : mailhog/mailhog
193156 ports :
@@ -208,19 +171,7 @@ jobs:
208171 checks : write
209172 needs : build-cache
210173 services :
211- postgres :
212- image : postgres
213-
214- env :
215- POSTGRES_PASSWORD : ${{ env.OSF_DB_PASSWORD }}
216- options : >-
217- --health-cmd pg_isready
218- --health-interval 10s
219- --health-timeout 5s
220- --health-retries 5
221- ports :
222- # Maps tcp port 5432 on service container to the host
223- - 5432:5432
174+ postgres : *POSTGRES_SERVICE
224175 steps :
225176 - uses : actions/checkout@v2
226177 - uses : ./.github/actions/start-build
0 commit comments