Merge branch 'master' of https://github.com/shunkosa/guest-article-vo… #12
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: unit test | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code in the pull request | |
- name: 'Checkout source code' | |
uses: actions/checkout@v2 | |
# Cache node_modules to speed up the process | |
- name: Restore node_modules cache | |
id: cache-npm | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm-${{ env.cache-name }}- | |
npm- | |
# Install npm dependencies for Prettier and Jest | |
- name: 'Install npm dependencies' | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: npm install | |
# Unit tests | |
- name: 'Unit test Lightning Web Components' | |
run: npm run test:unit | |
# Upload code coverage data | |
- name: 'Upload code coverage for LWC to Codecov.io' | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |