Update pharmacy-microservice-ci.yml #160
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Pharmacy CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-and-deploy-microservice: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run Docker | |
run: docker-compose up -d | |
- name: Wait for Kafka to be ready | |
run: npx wait-on tcp:127.0.0.1:${{ secrets.KAFKA_PORT }} && echo "Kafka is ready!" | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install dependencies (Microservice) | |
run: npm ci | |
working-directory: pharmacy | |
- name: ESLint check (Microservice) | |
run: npm run lint | |
working-directory: pharmacy | |
- name: Run tests (Microservice) | |
run: npm run test | |
working-directory: pharmacy | |
env: | |
MONGO_URI_TEST: ${{ secrets.MONGO_URI_TEST }} | |
ZOOKEEPER_PORT: ${{ secrets.ZOOKEEPER_PORT }} | |
KAFKA_PORT: ${{ secrets.KAFKA_PORT }} |