Skip to content

Commit

Permalink
ci: 💚 fix ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 13, 2024
1 parent a8c2128 commit 21a2971
Showing 1 changed file with 44 additions and 18 deletions.
62 changes: 44 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- uses: actions/[email protected]

- name: Load Node.js latest
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '20.x'

- name: Load cached modules
uses: actions/cache/[email protected]
- 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
Expand All @@ -37,12 +51,18 @@ jobs:
with:
node-version: '20.x'

- uses: actions/[email protected]
- 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:
Expand All @@ -56,12 +76,18 @@ jobs:
with:
node-version: '20.x'

- uses: actions/cache/[email protected]
- 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

0 comments on commit 21a2971

Please sign in to comment.