-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 |