Dispached tests by manuandru #270
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dispatch tests | |
run-name: Dispached tests by ${{ github.actor }} | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
test-microservice: | |
name: Testing ${{ matrix.path }} | |
runs-on: ubuntu-latest | |
services: | |
rabbitmq: | |
image: rabbitmq:3 | |
options: >- | |
--health-cmd "rabbitmq-diagnostics -q ping" | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 10 | |
ports: | |
- 5672:5672 | |
mongodb: | |
image: mongo | |
options: >- | |
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'" | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 10 | |
ports: | |
- 27017:27017 | |
strategy: | |
fail-fast: false | |
matrix: | |
path: ${{ fromJson(vars.MICROSERVICES_TO_TEST) }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run tests | |
run: | | |
npm run --workspace=${{ matrix.path }} test --if-present | |
env: | |
AMQP_URI: amqp://localhost:5672/ | |
MONGO_URI: mongodb://localhost:27017/?authMechanism=DEFAULT&authSource=admin; |