chore: Bump dependencies #87
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
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 |