Skip to content

Commit

Permalink
Add GH workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-xr authored May 17, 2024
1 parent 661f005 commit a432858
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build

on:
push:
branches: [main]
pull_request:

jobs:
# Separate build job for Rust (will run in parallel)
build-rust:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "8.0.x"

- name: Restore tools
run: dotnet tool restore

- name: Setup Node.js environment
uses: actions/[email protected]

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Build Rust
run: npm run build-rust

- name: Test Rust
run: npm run test-rust

# Separate build job for JavaScript
build-javascript:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "8.0.x"

- name: Restore tools
run: dotnet tool restore

- name: Setup Node.js environment
uses: actions/[email protected]

- name: Build JS
run: npm run build-js

- name: Test JS
run: npm run test-js-node
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build-rust-web": "npm run build-rust && wasm-pack build --target web",
"build-rust-node": "npm run build-rust && wasm-pack build --target nodejs",

"test-js-node": "npm run build-js && node out/main.js",
"test-rust-web": "npm run build-rust-web && npx http-server",
"test-rust-node": "npm run build-rust-node && node src/Functor.RayTracer/test_wasm.js",
"test-rust-target-cpu": "npm run build-rust && cargo run --config build.rustflags='\"-C target-cpu=native\"' --release",
Expand Down

0 comments on commit a432858

Please sign in to comment.