-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: improve node compatibility (#8)
* build: enable type checking for npm build * build: make npm build to run integration tests too * ci: run npm build in ci
- Loading branch information
Showing
22 changed files
with
205 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Node: Build + Integration" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v2 | ||
with: | ||
deno-version: v2.x # Run with latest stable Deno. | ||
|
||
- name: Start Pebble and pebble-challtestsrv | ||
run: deno task pebble:start --detach | ||
|
||
- name: Wait for Pebble to be ready | ||
run: | | ||
echo "⏳ Waiting for Pebble... 🪨" | ||
# Loop until the port 14000 is open | ||
until nc -zv localhost 14000 2>/dev/null; do | ||
sleep 1 | ||
done | ||
echo "✅ Pebble is running!" | ||
- name: Wait for pebble-challtestsrv to be ready | ||
run: | | ||
echo "⏳ Waiting for pebble-challtestsrv... 🪨" | ||
until nc -zv localhost 8055 2>/dev/null; do | ||
sleep 1 | ||
done | ||
echo "✅ pebble-challtestsrv is running!" | ||
- run: deno task build:npm:integration | ||
|
||
- name: Stop Pebble | ||
run: deno task pebble:stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
defaultResolveDns, | ||
type ResolveDnsFunction, | ||
} from "../../src/DnsUtils/resolveDns.ts"; | ||
|
||
/** | ||
* A resolveDns function specifically for integration tests to allow TXT lookups to be done via pebble-testchallsrv | ||
*/ | ||
export const resolveDns: ResolveDnsFunction = async (query, recordType) => { | ||
return (await defaultResolveDns(query, recordType, { | ||
nameServer: recordType === "TXT" | ||
? { | ||
ipAddr: "127.0.0.1", | ||
port: 8053, | ||
} // only lookup via pebble-challtestsrv for txt records | ||
: undefined, | ||
// deno-lint-ignore no-explicit-any -- typescript is hard | ||
})) as any; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const setupNode = () => { | ||
if ("process" in globalThis) { | ||
// @ts-ignore: node specific | ||
globalThis["process"]["env"]["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { build, type BuildOptions } from "jsr:@deno/dnt"; | ||
import { dntConfig } from "./build-npm.ts"; | ||
|
||
const config: BuildOptions = { | ||
...dntConfig, | ||
testPattern: "integration/**/*.test.ts", | ||
test: true, | ||
}; | ||
|
||
await build(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.