test.js.yml #1
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: Tests | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Install dependencies | |
run: npm install | |
- name: Run Jest tests | |
run: npm test -- --coverage | |
- name: Generate coverage badge | |
uses: mattallty/[email protected] | |
with: | |
output_file: coverage.svg | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download coverage badge | |
uses: actions/download-artifact@v2 | |
with: | |
name: coverage.svg | |
path: coverage.svg | |
- name: Commit coverage badge | |
uses: EndBug/add-and-commit@v4 | |
with: | |
author_name: Coverage Bot | |
author_email: [email protected] | |
message: "Update coverage badge [skip ci]" | |
add: "coverage.svg" |