From 21a297182f435aff81b3ff3a7727782a3b012511 Mon Sep 17 00:00:00 2001 From: Theodore Kruczek Date: Sat, 13 Jan 2024 00:31:04 -0500 Subject: [PATCH] ci: :green_heart: fix ci pipeline --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1934ca..37bc707 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,29 +3,43 @@ name: CI on: [pull_request] jobs: + compliance: + name: NPM Audit Report + runs-on: ubuntu-latest + steps: + # Checkout Code + - name: Checkout Code + uses: actions/checkout@v4 + # Audit Package.json + - name: NPM Audit Action + uses: oke-py/npm-audit-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} lint: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4.1.1 - - name: Load Node.js latest - uses: actions/setup-node@v4.0.1 + - uses: actions/setup-node@v4.0.1 with: node-version: '20.x' - - name: Load cached modules - uses: actions/cache/save@v3.3.3 + - uses: actions/cache@v3 + env: + cache-name: cache-node-modules with: path: | - **/node_modules - key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} + ~/.npm + **/lib + key: ${{ runner.os }}-build- ${{ env.cache-name }}- ${{hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - - name: Install all dependencies - run: npm ci + - run: npm ci - - name: Run ESLint - run: npm run lint + - run: npm run lint build: name: build needs: lint @@ -37,12 +51,18 @@ jobs: with: node-version: '20.x' - - uses: actions/cache@v3.3.3 + - uses: actions/cache@v3 + env: + cache-name: cache-node-modules with: path: | - **/node_modules + ~/.npm **/lib - key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-build- ${{ env.cache-name }}- ${{hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - run: npm run build test: @@ -56,12 +76,18 @@ jobs: with: node-version: '20.x' - - uses: actions/cache/restore@v3.3.3 + - uses: actions/cache@v3 + env: + cache-name: cache-node-modules with: path: | - **/node_modules + ~/.npm **/lib - key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-build- ${{ env.cache-name }}- ${{hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Test run: npm run test:nobuild