Skip to content

#50 chore: Bump dependencies #90

#50 chore: Bump dependencies

#50 chore: Bump dependencies #90

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
dependencies:
name: Restore dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create cache if changed
uses: actions/cache@v2
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Clean install
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
build:
name: Build
runs-on: ubuntu-latest
needs: dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Load dependencies from cache
uses: actions/cache@v2
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Restore dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
retention-days: 5
lint:
name: Lint
runs-on: ubuntu-latest
needs: dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Load dependencies from cache
uses: actions/cache@v2
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Restore dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Run linter
run: npm run lint
audit:
name: Audit
runs-on: ubuntu-latest
needs: dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Load dependencies from cache
uses: actions/cache@v2
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Restore dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Run audit
run: npm audit --production
test:
name: Test
runs-on: ubuntu-latest
needs: dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Load dependencies from cache
uses: actions/cache@v2
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Restore dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Run unit test
run: npm run test:ci
- name: Upload to Codecov
uses: codecov/[email protected]
with:
directory: ./coverage