From d4b2624bdcd4049ab55b2d5d94bcd66c77c352d5 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Thu, 2 Nov 2023 00:35:25 -0500 Subject: [PATCH] ci: Update Workflows --- .github/workflows/main.yml | 55 +++++++++++++++++++------------------- .github/workflows/snyk.yml | 4 ++- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 45007712..f4ecd47b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,41 +1,42 @@ name: CI + on: - pull_request: - types: - - opened - - synchronize + pull_request: + types: + - opened + - synchronize permissions: {} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: - test: - name: Run JS tests - runs-on: ubuntu-latest + test: + name: Run JS tests + runs-on: ubuntu-latest - env: - node: 'lts/*' + env: + node: 'lts/*' - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Setup Node.js - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 - with: - node-version: ${{ env.node }} - cache: 'yarn' + - name: Setup Node.js + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 + with: + node-version: ${{ env.node }} + cache: 'yarn' - - name: Install dependencies - run: yarn install --frozen-lockfile + - name: Install dependencies + run: yarn install --frozen-lockfile - - name: Run tests - run: yarn run test:ci + - name: Run tests + run: yarn run test:ci - - name: Upload coverage report - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d - with: - directory: coverage + - name: Upload coverage report + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d + with: + directory: coverage diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 4b27ea3d..61352e11 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -42,6 +42,8 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.ref }} - - uses: snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0 + - run: npm install -g snyk + + - run: snyk test env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}