Skip to content

Commit

Permalink
chore: Add codecov to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
svsool committed Aug 1, 2020
1 parent 9d2074d commit 0f96a76
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
matrix:
os: [macos-10.15, ubuntu-18.04, windows-2019]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Setup Node
Expand All @@ -46,7 +48,14 @@ jobs:
- name: Run Tests
uses: GabrielBB/[email protected]
with:
run: yarn test
run: yarn test:ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/
env_vars: OS
fail_ci_if_error: true
create_release:
name: Create Release
if: success() && startsWith(github.ref, 'refs/tags/v')
Expand All @@ -67,7 +76,7 @@ jobs:
files: |
markdown-memo-*.vsix
publish:
name: Publish
name: Publish Release
runs-on: ubuntu-18.04
needs: [create_release]
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
*.vsix
yarn-error.log
VERSION
coverage/
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ yarn-error.log
**/*.ts
node_modules
VERSION
coverage/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Inspired by [Obsidian.md](https://obsidian.md/) and [RoamResearch](https://roamr

[![](https://vsmarketplacebadge.apphb.com/version-short/svsool.markdown-memo.svg)](https://marketplace.visualstudio.com/items?itemName=svsool.markdown-memo)
[![](https:/svsool/vscode-memo/workflows/CI/badge.svg?branch=master)](https:/svsool/vscode-memo/actions?query=workflow%3ACI+branch%3Amaster)
[![codecov](https://codecov.io/gh/svsool/vscode-memo/branch/master/graph/badge.svg)](https://codecov.io/gh/svsool/vscode-memo)

## Why?

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,15 @@
"clean": "rimraf dist out",
"lint": "eslint src --ext ts",
"compile": "webpack --mode development",
"compile:tests": "tsc -p ./ && yarn run webpack --mode development",
"watch": "webpack --mode development -w",
"pretest": "tsc -p ./ && yarn run webpack --mode development",
"pretest": "yarn compile:tests",
"pretest:ci": "yarn compile:tests",
"pretest:watch": "yarn compile:tests",
"release": "standard-version",
"ts": "tsc --noEmit",
"test": "node ./out/test/runTest.js",
"test:ci": "cross-env JEST_COLLECT_COVERAGE=true node ./out/test/runTest.js",
"test:watch": "cross-env JEST_WATCH=true node ./out/test/runTest.js"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/test/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function run(): Promise<void> {
},
}),
watch: process.env.JEST_WATCH === 'true',
collectCoverage: process.env.JEST_COLLECT_COVERAGE === 'true',
},
[rootDir],
);
Expand Down

0 comments on commit 0f96a76

Please sign in to comment.