diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2260b8..1a7185a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,43 @@ name: HMS Backend CI + on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + push: + branches: [ main ] + pull_request: + branches: [ main ] + jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.x] - mongodb: - image: mongo:6.0 - ports: - - 27017:27017 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: Install dependencies - run: npm ci - - - name: Run Lint - run: npm run lint - - - name: Run Tests - run: npm test - - - name: Build docker image - run: docker build -t hms-backend:${{ github.sha }} . \ No newline at end of file + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + services: + mongodb: + image: mongo:6.0 + ports: + - 27017:27017 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run Lint + run: npm run lint + + - name: Run Tests + run: npm test + + - name: Build docker image + run: docker build -t hms-backend:${{ github.sha }} . \ No newline at end of file