Skip to content

Commit 3d2507e

Browse files
author
Fil Maj
authored
ci: Better dependency management, run tests against high and low version of deno (#79)
* Move script-only dependencies into their own deps file under the scripts/src directory. Comment at the top of deps.ts and dev_deps.ts to guide what version of deno std we should use. run tests against most recent stable deno as well as minimum deno version used internally Move import map helper scripts (for use with sample app integration testing) under scripts/src, add comments to scripts/deps.ts to explain stdlib versioning strategy. Run both CI workflows against most recent stable deno as well as version of deno used by Run on Slack. Name deno CI workflow more specifically Set min deno version to 1.31.1 (version Run on Slack uses), set deno stdlib version to 0.178.0 (recommended for deno v1.31.1), update tests as a result of assertion method changes in 0.178.0. * Ensure exception is thrown in a couple of API tests. * Added comments and minor tweaks that arose from review. * fixes * bump deno version for samples integration * axe doubled up code
1 parent 0a7a819 commit 3d2507e

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

.github/workflows/deno.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deno
1+
name: Deno Format, Lint and Unit Tests
22

33
on:
44
push:
@@ -9,13 +9,18 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
# we test on both most recent stable version of deno (v1.x) as well as
15+
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
16+
deno-version: [v1.x, v1.45.4]
1217
steps:
1318
- name: Setup repo
1419
uses: actions/checkout@v4
1520
- name: Setup Deno
1621
uses: denoland/setup-deno@v1
1722
with:
18-
deno-version: v1.x
23+
deno-version: ${{ matrix.deno-version }}
1924
- name: Run formatter, linter and tests
2025
run: deno task test
2126
- name: Generate CodeCov-friendly coverage report

.github/workflows/samples.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ jobs:
1919
- slack-samples/deno-message-translator
2020
- slack-samples/deno-request-time-off
2121
- slack-samples/deno-simple-survey
22+
# we test on both most recent stable version of deno (v1.x) as well as
23+
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
24+
deno-version: [v1.x, v1.45.4]
2225

2326
steps:
24-
- name: Setup Deno
27+
- name: Setup Deno ${{ matrix.deno-version }}
2528
uses: denoland/setup-deno@v1
2629
with:
27-
deno-version: v1.x
30+
deno-version: ${{ matrix.deno-version }}
2831

2932
- name: Checkout the api
3033
uses: actions/checkout@v4
@@ -37,10 +40,10 @@ jobs:
3740
path: ./sample
3841

3942
- name: Set imports.deno-slack-api/ to ../deno-slack-api/src/ in import_map.json
40-
run: >
43+
run: >
4144
deno run
4245
--allow-read --allow-write --allow-net
43-
deno-slack-api/scripts/import_map/update.ts
46+
deno-slack-api/scripts/src/import_map/update.ts
4447
--import-map "./sample/import_map.json"
4548
--parent-import-map "./deno-slack-api/deno.jsonc"
4649
--api "../deno-slack-api/src/"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isHttpError } from "@std/http/http-errors";
2-
import { mf } from "../../src/dev_deps.ts";
2+
import { mf } from "../../../src/dev_deps.ts";
33
import { assertEquals, assertRejects } from "@std/assert";
44
import { afterEach, beforeAll } from "@std/testing/bdd";
55
import { apiDepsIn } from "./update.ts";

src/typed-method-types/workflows/triggers/inputs.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ type InputSchema<Params extends InputParameterSchema> = Params extends
6060
type WorkflowInputsType<Params extends InputParameterSchema> =
6161
// This intentionally avoids Distributive Conditional Types, so be careful removing any of the following square brackets
6262
// See https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types for more details
63-
[keyof Params["properties"]] extends [string]
64-
// Since never extends string, must check for no properties
63+
[keyof Params["properties"]] extends [string] // Since never extends string, must check for no properties
6564
? [keyof Params["properties"]] extends [never] ? EmptyInputs
66-
: Params["required"] extends Array<infer T> ? [T] extends [never]
67-
// If there are no required properties, inputs are optional
65+
: Params["required"] extends Array<infer T> ? [T] extends [never] // If there are no required properties, inputs are optional
6866
? PopulatedInputs<Params>
6967
// If there are required params, inputs are required
7068
: Required<PopulatedInputs<Params>>

src/typed-method-types/workflows/triggers/tests/webhook_test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ Deno.test("Mock call for webhook", async (t) => {
9090
);
9191
}
9292
mf.reset();
93-
94-
mf.reset();
9593
},
9694
);
9795
});

0 commit comments

Comments
 (0)