Skip to content

Commit c296d63

Browse files
authoredNov 28, 2023
Merge pull request #746 from cressie176/main
Make CI more robust
2 parents 4791f2d + 8d27214 commit c296d63

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
 

‎.github/workflows/test.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
services:
1616
rabbitmq:
17-
image: rabbitmq
17+
image: rabbitmq:3.12-alpine
1818
ports:
1919
- 5672:5672
2020

2121
strategy:
2222
matrix:
23-
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
23+
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
2424
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2525

2626
steps:
@@ -34,5 +34,18 @@ jobs:
3434
# Install all prerequisites
3535
- run: npm ci
3636

37+
# Ensure RabbitMQ is available before continuing
38+
- run: |
39+
n=0
40+
while :
41+
do
42+
sleep 5
43+
echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP
44+
[[ $? = 0 ]] && break || ((n++))
45+
(( n >= 5 )) && break
46+
done
47+
48+
- run: echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP
49+
3750
# Run the tests
3851
- run: make test

0 commit comments

Comments
 (0)
Please sign in to comment.