You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi pals, the following is my GitHub action, the problem is MongoDB is not getting recognised or having some issue wile running the jobs.
Even mongoimport is not recognised because mongo is not getting detected. Give me the following error
mongoimport: command not found
name: API Continous Integration
# Controls when the action will run. Triggers the workflow on push or pull request
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
continous_integration:
runs-on: ubuntu-latest
strategy:
#We can run on multiple versions of dependencies with the help of 'matrix'
matrix:
node-version: [18.x]
mongodb-version: ["6.0"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
#Checkout project code
- name: Git Checkout
uses: actions/checkout@v3
#Install Node.js
- name: Install NodeJs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
#MongoDB server
- name: Start MongoDB ${{ matrix.mongodb-version }}
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-username: ${{ secrets.DB_MONGODB_USERNAME }}
mongodb-password: ${{ secrets.DB_MONGODB_PASSWORD }}
mongodb-db: ${{ secrets.DB_MONGODB_DATABASE }}
mongodb-port: ${{ secrets.DB_MONGODB_PORT }}
#Load mongodb collections
- name: Add data to countries Collection
run: mongoimport --host=127.0.0.1 --db=${{ secrets.DB_MONGODB_DATABASE }} --port=${{ secrets.DB_MONGODB_PORT }} --username=${{ secrets.DB_MONGODB_USERNAME }} --password=${{ secrets.DB_MONGODB_PASSWORD }} --collection=countries --file=src/database/raw/countries.json
#Clean install package and any packages that it depends on
- name: Install dependencies
run: npm ci
#Run the integration tests
- name: Run tests
run: npm test
The text was updated successfully, but these errors were encountered:
If I use ubuntu-20.04 I am able to make it work. Also I know that mongoimport is removed in Ubuntu 22.x, but tried multiple other options but not working with ubuntu-latest
Hi pals, the following is my GitHub action, the problem is MongoDB is not getting recognised or having some issue wile running the jobs.
Even mongoimport is not recognised because mongo is not getting detected. Give me the following error
The text was updated successfully, but these errors were encountered: