update the workflow to verify the lock file exists #3
Workflow file for this run
This file contains hidden or 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: Run Mocha Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - tests | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| path: node-express-server | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Verify `yarn.lock` exists | |
| run: | | |
| if [ ! -f node-express-server/yarn.lock ]; then | |
| echo "Error: yarn.lock file is missing in node-express-server directory" | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: yarn install | |
| working-directory: node-express-server | |
| - name: Run Mocha tests | |
| run: npx mocha test/webserver.test.js | |
| working-directory: node-express-server |