From 75dc1a7c1245591e0e4fb8b05e34f78fc86eaed0 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Mon, 13 May 2024 12:39:33 -0400 Subject: [PATCH 1/4] 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 --- .github/workflows/{deno.yml => deno-ci.yml} | 17 +++++++++++++---- deno.jsonc | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) rename .github/workflows/{deno.yml => deno-ci.yml} (62%) 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..01274fe 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.0.2 + 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..ebd5b75 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -25,7 +25,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": { From 8e1d1c8e70f58b04d6a1a655ac43ebf231425d4e Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Mon, 13 May 2024 13:37:36 -0400 Subject: [PATCH 2/4] Add codecov badge, tweak maintainer guide. --- .github/maintainers_guide.md | 2 +- src/README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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/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: From d638a017b22f5778ae6419029512ba7109fc1443 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Mon, 13 May 2024 13:49:28 -0400 Subject: [PATCH 3/4] Fix syntax error import test in latest deno. --- deno.jsonc | 6 ++++-- src/tests/fixtures/functions/syntaxerror.ts | 2 +- src/tests/load-function-module.test.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deno.jsonc b/deno.jsonc index ebd5b75..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 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", ); }); From 683f2b46916eda91f72692d5c7ffce50345f678e Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Mon, 13 May 2024 14:50:32 -0400 Subject: [PATCH 4/4] use flaoting versions of health score --- .github/workflows/deno-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deno-ci.yml b/.github/workflows/deno-ci.yml index 01274fe..2a65f73 100644 --- a/.github/workflows/deno-ci.yml +++ b/.github/workflows/deno-ci.yml @@ -40,7 +40,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Report health score - uses: slackapi/slack-health-score@v0.0.2 + uses: slackapi/slack-health-score@v0 with: codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}