Skip to content

Commit

Permalink
test: add coverage, deploy to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed May 27, 2021
1 parent 97748c4 commit 09dddb5
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-ties-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stacks/wallet-web': patch
---

Adds code coverage and deploys to Github Pages https://blockstack.github.io/stacks-wallet-web/
46 changes: 46 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: GH pages

on:
push:
branches:
- 'main'

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16

- name: Cache node_modules
id: cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn

- name: Build prod
run: yarn build

- name: Run jest
run: yarn test:unit

- name: Make badge maker
run: npx make-coverage-badge

- name: Publish test coverage report
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ packages
web-ext-artifacts/
.yalc/
yalc.lock
coverage/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Stacks Wallet for web

[![coverage](https://raw.githubusercontent.com/blockstack/stacks-wallet-web/gh-pages/badge.svg)](https://blockstack.github.io/stacks-wallet-web/)

Stacks Wallet is a browser extension for managing your digital assets and connecting to apps built with the Stacks blockchain.

Source code is available on GitHub at https://github.com/blockstack/stacks-wallet-web/tree/main
Expand Down
5 changes: 3 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ module.exports = {
// Automatically clear mock calls and instances between every test
// clearMocks: false,

// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,
collectCoverage: true,

coverageReporters: ['html', 'json-summary'],

// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
Expand Down

1 comment on commit 09dddb5

@vercel
Copy link

@vercel vercel bot commented on 09dddb5 May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.