Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH workflow #1

Merged
merged 9 commits into from
May 17, 2024
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
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
Loading