Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/ValidatePullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,43 @@ permissions:
contents: read

jobs:
spelling:
name: Spell check with typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Spell Check Repo
uses: crate-ci/typos@v1.43.5

build:
uses: ./.github/workflows/dep_build.yml
secrets: inherit

benchmarks:
uses: ./.github/workflows/dep_benchmarks.yml
secrets: inherit
with:
download-benchmarks: true
upload-benchmarks: false


build:
uses: ./.github/workflows/dep_build.yml
secrets: inherit

license-headers:
name: check license headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check License Headers
run: ./dev/check-license-headers.sh

# Gate PR merges on this specific "join-job" which requires all other
# jobs to run first.
report-ci-status:
needs:
- build
- benchmarks
- build
- license-headers
- spelling
if: always()
runs-on: ubuntu-latest
steps:
- name: calculate the correct exit status
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

spelling:
name: Spell check with typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Spell Check Repo
uses: crate-ci/typos@v1.43.5
3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ check-npm:
check:
cargo check

check-license-headers:
./dev/check-license-headers.sh

clippy target=default-target features="": (ensure-tools)
cd src/hyperlight-js-runtime && \
cargo hyperlight clippy \
Expand Down
55 changes: 55 additions & 0 deletions dev/check-license-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# This script checks for the presence of the required license header in Rust source files.

# Get the repository root
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$REPO_ROOT" || exit 1

# Define the license header pattern to look for
LICENSE_PATTERN="Copyright .* The Hyperlight Authors..*Licensed under the Apache License, Version 2.0"

# Define the full license header for files that need it
LICENSE_HEADER='/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'

# Initialize a variable to track missing headers
MISSING_HEADERS=0
MISSING_FILES=""

# Find all Rust files
while IFS= read -r -d $'\0' file; do
# Check if the file has the license header (allowing for multi-line matching)
if ! grep -q -z "$LICENSE_PATTERN" "$file"; then
echo "Missing or invalid license header in $file"
MISSING_FILES="$MISSING_FILES\n $file"
MISSING_HEADERS=$((MISSING_HEADERS + 1))
fi
done < <(find src -name "*.rs" -type f -print0)

if [ $MISSING_HEADERS -gt 0 ]; then
echo "Found $MISSING_HEADERS files with missing or invalid license headers:"
echo -e "$MISSING_FILES"
echo ""
echo "Please add the following license header to these files:"
echo "$LICENSE_HEADER"
echo "You can also run: just check-license-headers to verify your changes."
exit 1
else
echo "All Rust files have the required license header"
exit 0
fi
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
fn main() {
if std::env::var_os("CARGO_CFG_HYPERLIGHT").is_none() {
return;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/globals/console.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use rquickjs::object::Property;
use rquickjs::{Ctx, Module, Object};

Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/globals/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use rquickjs::Ctx;

mod console;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/globals/print.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use rquickjs::object::Property;
use rquickjs::{Ctx, Function, Module, Object};

Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/globals/require.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use rquickjs::object::Property;
use rquickjs::{Ctx, Function, Module, Object};

Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/globals/string.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use alloc::string::{String, ToString as _};

use base64::engine::general_purpose::STANDARD_NO_PAD;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/host.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use alloc::string::String;

use anyhow::Result;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/host_fn.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use alloc::format;
use alloc::rc::Rc;
use alloc::string::{String, ToString as _};
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#![no_std]
#![no_main]
extern crate alloc;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#![cfg_attr(hyperlight, no_std)]
#![cfg_attr(hyperlight, no_main)]

Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/main/hyperlight.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
extern crate alloc;

use core::ffi::*;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/main/native.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use std::path::{Path, PathBuf};
use std::{env, fs};

Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/modules/console.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use alloc::string::String;

use rquickjs::prelude::Rest;
Expand Down
15 changes: 15 additions & 0 deletions src/hyperlight-js-runtime/src/modules/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2026 The Hyperlight Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use alloc::format;
use alloc::rc::Rc;
use alloc::string::String;
Expand Down
Loading