This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
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.
* add tests and CI Signed-off-by: John Sahhar <[email protected]>
- Loading branch information
ok-john
authored
Nov 5, 2022
1 parent
ae21c74
commit fe36d1f
Showing
14 changed files
with
239 additions
and
337 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,19 @@ | ||
name: Javascript Tests | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
format: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run js tests | ||
run: ./example/ci-test.sh | ||
|
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,29 @@ | ||
name: Formatting | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
format: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
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,25 @@ | ||
name: Testing | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo test | ||
run: cargo test --release |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
/Cargo.lock | ||
node_modules | ||
/Cargo.lock |
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,29 @@ | ||
#!/bin/bash | ||
readonly EXEC_DIR=$(dirname "$(realpath $0)") | ||
readonly NODE_VERSION="v18.12.1" | ||
readonly NODE_OS="linux" | ||
readonly NODE_ARCH="x64" | ||
readonly FN="node-$NODE_VERSION-$NODE_OS-$NODE_ARCH" | ||
|
||
# Install rust | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
rustup update nightly | ||
rustup update stable | ||
rustup default stable | ||
rustup target add wasm32-unknown-unknown --toolchain nightly | ||
cargo install wasm-pack | ||
|
||
# Compile/link typescript library | ||
make | ||
make link | ||
|
||
# Install JS dependencies | ||
cd $EXEC_DIR | ||
wget https://nodejs.org/dist/$NODE_VERSION/$FN.tar.xz | ||
tar xf $FN.tar.xz | ||
export PATH=$PATH:$EXEC_DIR/$FN/bin | ||
npm install -g ts-node | ||
|
||
# Run tests | ||
ts-node test.ts | ||
|
Oops, something went wrong.