## # Run tests ## name: Tests on: pull_request: push: jobs: pre_build: runs-on: ubuntu-latest steps: - uses: fkirc/skip-duplicate-actions@master with: github_token: ${{ github.token }} cancel_others: true test: name: Run Tests needs: pre_build runs-on: ubuntu-latest steps: - name: Check out Git repository uses: actions/checkout@v3 - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v3 with: node-version: 16 - name: Cache node modules uses: actions/cache@v3 id: cache with: path: node_modules key: node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm install --legacy-peer-deps - run: npm run lint - run: npm test notify: name: Notify Slack needs: test if: ${{ success() || failure() }} runs-on: ubuntu-latest steps: - uses: iRoachie/slack-github-actions@v2.3.0 if: env.SLACK_WEBHOOK_URL != null env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILDS_WEBHOOK_URL }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}