[Chore] - Updated CI and Added Caching Feature #173
Workflow file for this run
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: 3Dmol.js CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
push: | |
branches: [master] | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Cache NPM Dependencies | |
id: cache-npm | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
- name: Check Cache & Install Dependencies | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: npm install --no-audit | |
- name: Build 3Dmol.js | |
run: npm run build | |
- name: Test | |
run: npm test | |
- name: Coverage | |
env: | |
NODE_OPTIONS: "--max_old_space_size=8192" | |
run: npm run cover | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |