diff --git a/.github/maintainers_guide.md b/.github/maintainers_guide.md index f9940ec..58a00fd 100644 --- a/.github/maintainers_guide.md +++ b/.github/maintainers_guide.md @@ -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 diff --git a/.github/workflows/deno.yml b/.github/workflows/deno-ci.yml similarity index 62% rename from .github/workflows/deno.yml rename to .github/workflows/deno-ci.yml index 245c3e9..2a65f73 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno-ci.yml @@ -20,10 +20,10 @@ 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 @@ -31,9 +31,18 @@ jobs: 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 diff --git a/deno.jsonc b/deno.jsonc index 3dc2e77..3899bcd 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -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, @@ -15,7 +16,8 @@ }, "lint": { "files": { - "include": ["src"] + "include": ["src"], + "exclude": ["src/tests/fixtures"] }, "rules": { // [TODO]: Remove exclusion after we remove Deno.run @@ -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/code_coverage@0.2.0/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": { diff --git a/src/README.md b/src/README.md index 6a41ebc..5e9bca2 100644 --- a/src/README.md +++ b/src/README.md @@ -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: diff --git a/src/tests/fixtures/functions/syntaxerror.ts b/src/tests/fixtures/functions/syntaxerror.ts index cc1a183..f58dfe2 100644 --- a/src/tests/fixtures/functions/syntaxerror.ts +++ b/src/tests/fixtures/functions/syntaxerror.ts @@ -1,4 +1,4 @@ export default async function thisShouldNotCompile() { const _yes = "no"; - return await { outputs: { ye } }; + return await { outputs: { ye }; } diff --git a/src/tests/load-function-module.test.ts b/src/tests/load-function-module.test.ts index 24732c9..60f4653 100644 --- a/src/tests/load-function-module.test.ts +++ b/src/tests/load-function-module.test.ts @@ -45,7 +45,7 @@ Deno.test("LoadFunctionModule function", async (t) => { ); }, TypeError, - "[ERROR]", + "could not be parsed", ); });