From 6560950b652cfd7c7ef1fe1be0e36147a7e1d299 Mon Sep 17 00:00:00 2001 From: Jeroen akkerman Date: Sun, 18 Sep 2022 02:20:36 +0200 Subject: [PATCH] Update workflow file --- .github/workflows/cd.yaml | 41 ++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index ea99212..a9e24fc 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -12,39 +12,49 @@ on: - master jobs: + + audit: + + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-node@v3 + with: + node-version: current + + - uses: actions/checkout@v3 + + - run: npm audit --omit=dev + test: + needs: [ audit ] runs-on: ubuntu-latest strategy: matrix: - node-version: [ '12', '14', '16', '18' ] + node-version: [ '14', '16', '18' ] steps: - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Checkout - uses: actions/checkout@v2 - - - name: Audit - run: npm audit --production + - uses: actions/checkout@v3 - - name: Install packages - run: npm install + - run: npm ci - name: Test run: npm test - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: failure() with: name: cypress-screenshots path: cypress/screenshots retention-days: 7 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: always() with: name: cypress-videos @@ -58,14 +68,13 @@ jobs: if: github.event_name == 'push' steps: - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: current - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Install packages - run: npm install + - run: npm ci - name: Deploy @latest version to npm if: startsWith(github.ref, 'refs/tags/')