File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Run tests
2+
3+ on :
4+ push :
5+
6+ jobs :
7+ build :
8+ runs-on : ubuntu-latest
9+ timeout-minutes : 10
10+
11+ strategy :
12+ matrix :
13+ node-version : [20.x, 22.x, 24.x]
14+ rabbit-version : [3.12.5, 4.2.1]
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v6
19+
20+ - name : Use Node.js ${{ matrix.node-version }}
21+ uses : actions/setup-node@v6
22+ with :
23+ node-version : ${{ matrix.node-version }}
24+
25+ - name : Start services
26+ run : docker compose up -d --wait
27+ env :
28+ RABBITMQ_VERSION : ${{ matrix.rabbit-version }}
29+
30+ - name : Run tests
31+ run : |
32+ npm install
33+ npm test
34+
35+ - name : Stop services
36+ if : always()
37+ run : docker compose down -v
38+
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ node_modules
33coverage
44typings
55js
6- . *
6+ .nyc_output
Original file line number Diff line number Diff line change 1- version : ' 2.2'
21services :
3- rabbit-queue :
4- image : node:14
5- working_dir : /code
6- volumes :
7- - .:/code
8- links :
9- - rabbit
10- environment :
11- RABBIT_URL : ' amqp://rabbit'
12- rabbit :
13- image : rabbitmq
2+ rabbitmq :
3+ image : rabbitmq:${RABBITMQ_VERSION:-4.1.2}-management
4+ container_name : rabbitmq
145 ports :
15- - ' 5672:5672'
6+ - 5672:5672
7+ - 15672:15672
8+ healthcheck :
9+ test : rabbitmq-diagnostics -q ping
10+ timeout : 10s
11+ interval : 5s
12+ retries : 5
13+
Original file line number Diff line number Diff line change 1616 "prepublishOnly" : " npm run build && npm run test-docker" ,
1717 "pretest" : " tslint --project ./ts/ && tslint ./test/**/*.ts && npm run build" ,
1818 "test" : " nyc mocha" ,
19- "test-docker " : " docker- compose run rabbit-queue npm run test " ,
20- "prepare " : " npm run build "
19+ "deps:up " : " docker compose up -d --wait " ,
20+ "deps:down " : " docker compose down "
2121 },
2222 "lint-staged" : {
2323 "*.{ts,js}" : [
You can’t perform that action at this time.
0 commit comments