github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/.github/workflows/tests-js.yml (about) 1 name: JS Tests 2 3 on: 4 push: 5 branches: [main] 6 pull_request: 7 branches: [main] 8 9 jobs: 10 js-tests: 11 runs-on: ubuntu-latest 12 steps: 13 - name: Checkout 14 uses: actions/checkout@v2 15 - uses: actions/setup-node@v2 16 with: 17 node-version: '16.18' 18 - name: Get yarn cache directory path 19 id: yarn-cache-dir-path 20 run: echo "::set-output name=dir::$(yarn cache dir)" 21 22 - uses: actions/cache@v2 23 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 24 with: 25 path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 26 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 27 restore-keys: | 28 ${{ runner.os }}-yarn 29 30 - name: Install Webapp dependencies 31 run: yarn install --frozen-lockfile 32 - name: Get number of CPU cores 33 id: cpu-cores 34 uses: SimenB/github-actions-cpu-cores@v1 35 - name: Run Webapp tests 36 run: yarn run test --coverage --max-workers ${{ steps.cpu-cores.outputs.count }} 37 - name: Upload codecov coverage 38 if: always() 39 uses: codecov/codecov-action@v1 40 with: 41 name: js coverage 42 fail_ci_if_error: false 43 verbose: true