Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage report fixes and Action updates #62

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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