diff --git a/Mocha/mongo_express_api/.github/workflows/main.yml b/.github/workflows/main.yml similarity index 90% rename from Mocha/mongo_express_api/.github/workflows/main.yml rename to .github/workflows/main.yml index 7e67e65..5be260e 100644 --- a/Mocha/mongo_express_api/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ on: push: branches: [main] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + jobs: test: @@ -27,6 +30,7 @@ jobs: - name: NPM install, build and test run: | + cd Mocha/mongo_express_api npm install npm test env: diff --git a/.github/workflows/mocha.yml b/.github/workflows/mocha.yml new file mode 100644 index 0000000..c6472ea --- /dev/null +++ b/.github/workflows/mocha.yml @@ -0,0 +1,39 @@ +name: Node.JS CI/CD + +on: + push: + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + mocha-tests: + name: Test + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Use Node.JS ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: NPM install, build and test + run: | + cd Mocha/mongo_express_api + npm install + npm test + env: + DBHOST: ${{ secrets.DBHOST }} + TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} + JWT_EXPIRES_IN: ${{ secrets.JWT_EXPIRES_IN }} \ No newline at end of file