summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/workflows/ci.generate.ts13
-rw-r--r--.github/workflows/ci.yml9
-rw-r--r--core/extensions.rs6
-rw-r--r--runtime/examples/extension_with_esm/main.rs2
4 files changed, 24 insertions, 6 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 8d11e297f..9446a44b8 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -697,7 +697,7 @@ const ci = {
{
name: "Test debug (fast)",
if: [
- "matrix.job == 'test' && matrix.profile == 'debug' && ",
+ "matrix.job == 'test' && matrix.profile == 'debug' &&",
"!startsWith(matrix.os, 'ubuntu')",
].join("\n"),
run: [
@@ -709,6 +709,17 @@ const ci = {
env: { CARGO_PROFILE_DEV_DEBUG: 0 },
},
{
+ name: "Test examples debug",
+ if: "matrix.job == 'test' && matrix.profile == 'debug'",
+ run: [
+ // Only regression tests here for now.
+ // Regression test for https://github.com/denoland/deno/pull/19615.
+ "cargo run -p deno_runtime --example extension_with_esm",
+ "cargo run -p deno_runtime --example extension_with_esm --features include_js_files_for_snapshotting",
+ ].join("\n"),
+ env: { CARGO_PROFILE_DEV_DEBUG: 0 },
+ },
+ {
name: "Test release",
if: [
"matrix.job == 'test' && matrix.profile == 'release' &&",
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d197c2b5f..39da43682 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -428,13 +428,20 @@ jobs:
CARGO_PROFILE_DEV_DEBUG: 0
- name: Test debug (fast)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'debug' &&
+ !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'debug' &&
!startsWith(matrix.os, 'ubuntu'))
run: |-
cargo test --locked --lib
cargo test --locked --test '*'
env:
CARGO_PROFILE_DEV_DEBUG: 0
+ - name: Test examples debug
+ if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''test'' && matrix.profile == ''debug'')'
+ run: |-
+ cargo run -p deno_runtime --example extension_with_esm
+ cargo run -p deno_runtime --example extension_with_esm --features include_js_files_for_snapshotting
+ env:
+ CARGO_PROFILE_DEV_DEBUG: 0
- name: Test release
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'release' &&
diff --git a/core/extensions.rs b/core/extensions.rs
index e76b4064b..e4de3d217 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -622,8 +622,8 @@ macro_rules! include_js_files {
$($crate::ExtensionFileSource {
specifier: concat!("ext:", stringify!($name), "/", $file),
code: $crate::ExtensionFileSourceCode::IncludedInBinary(
- include_str!(concat!($dir, "/", $file)
- )),
+ include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/", $dir, "/", $file))
+ ),
},)+
]
};
@@ -633,7 +633,7 @@ macro_rules! include_js_files {
$($crate::ExtensionFileSource {
specifier: concat!("ext:", stringify!($name), "/", $file),
code: $crate::ExtensionFileSourceCode::IncludedInBinary(
- include_str!($file)
+ include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/", $file))
),
},)+
]
diff --git a/runtime/examples/extension_with_esm/main.rs b/runtime/examples/extension_with_esm/main.rs
index 6b21460a3..f8efdbe2f 100644
--- a/runtime/examples/extension_with_esm/main.rs
+++ b/runtime/examples/extension_with_esm/main.rs
@@ -13,7 +13,7 @@ use deno_runtime::worker::WorkerOptions;
deno_core::extension!(
hello_runtime,
esm_entry_point = "ext:hello_runtime/bootstrap.js",
- esm = ["bootstrap.js"]
+ esm = [dir "examples/extension_with_esm", "bootstrap.js"]
);
#[tokio::main]