Skip to content

Commit

Permalink
Code coverage report fixes, Action updates, added Health Score check (#…
Browse files Browse the repository at this point in the history
…62)

* Integrate health score, update GH actions and use org-wide codecov token to upload coverage reports. Drop use of third party lib to report coverage

* Add codecov badge, tweak maintainer guide.
  • Loading branch information
filmaj authored May 13, 2024
1 parent f78fa50 commit 6cb7261
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deno task test
You can also run a test coverage report with:

```zsh
deno task coverage
deno task test:coverage
```

### Lint and format
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/deno.yml → .github/workflows/deno-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,29 @@ jobs:

steps:
- name: Setup repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1.1.0
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Run tests
run: deno task test

- name: Generate CodeCov-friendly coverage report
run: deno task coverage
run: deno task generate-lcov

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v4
with:
file: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}

- name: Report health score
uses: slackapi/slack-health-score@v0
with:
codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
extension: ts
include: src
9 changes: 6 additions & 3 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
"fmt": {
"files": {
"include": ["src", "docs", "README.md"]
"include": ["src", "docs", "README.md"],
"exclude": ["src/tests/fixtures"]
},
"options": {
"semiColons": true,
Expand All @@ -15,7 +16,8 @@
},
"lint": {
"files": {
"include": ["src"]
"include": ["src"],
"exclude": ["src/tests/fixtures"]
},
"rules": {
// [TODO]: Remove exclusion after we remove Deno.run
Expand All @@ -25,7 +27,8 @@
"lock": false,
"tasks": {
"test": "deno fmt --check && deno lint && deno test --allow-read",
"coverage": "rm -rf .coverage && deno test --allow-read --coverage=.coverage src && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage && deno run --allow-read https://deno.land/x/[email protected]/cli.ts"
"generate-lcov": "rm -rf .coverage && deno test --reporter=dot --allow-read --coverage=.coverage && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage",
"test:coverage": "deno task generate-lcov && deno coverage --exclude=fixtures --exclude=test .coverage"
},
"test": {
"files": {
Expand Down
2 changes: 2 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# deno-slack-runtime

[![codecov](https://codecov.io/gh/slackapi/deno-slack-runtime/graph/badge.svg?token=D7U34ERPH0)](https://codecov.io/gh/slackapi/deno-slack-runtime)

Helper library for running a Run on Slack Deno function. The goal of this
project is to provide modules for:

Expand Down
2 changes: 1 addition & 1 deletion src/tests/fixtures/functions/syntaxerror.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default async function thisShouldNotCompile() {
const _yes = "no";
return await { outputs: { ye } };
return await { outputs: { ye };
}
2 changes: 1 addition & 1 deletion src/tests/load-function-module.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Deno.test("LoadFunctionModule function", async (t) => {
);
},
TypeError,
"[ERROR]",
"could not be parsed",
);
});

Expand Down

0 comments on commit 6cb7261

Please sign in to comment.