Skip to content

Commit

Permalink
Merge pull request #10 from redbadger/wasip2-components
Browse files Browse the repository at this point in the history
wasm32-wasip2 target
  • Loading branch information
StuartHarris authored Aug 11, 2024
2 parents 8eacae7 + d9e1292 commit 18d9d35
Show file tree
Hide file tree
Showing 99 changed files with 4,110 additions and 1,610 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/wasm-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and test WebAssembly components
on:
push:
branches:
- "main"
paths:
- "wasm-components/**"

pull_request:
branches:
- "main"
paths:
- "wasm-components/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
if: |
${{ github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name }}
defaults:
run:
working-directory: wasm-components

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-wasip2
components: rustfmt

- name: Build
shell: bash
working-directory: wasm-components/rust
run: |
cargo fmt --all --check
cargo build --workspace
- name: Install nextest
shell: bash
run: |
set -euxo pipefail
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Run tests
shell: bash
working-directory: wasm-components/rust
run: |
rm .cargo/config.toml # so we don't attempt to execute wasm directly
cargo nextest run --all-features
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
build/
target/
keys/
**/wit/deps/*
sentinel
*.creds
2 changes: 2 additions & 0 deletions wasm-components/rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "wasm32-wasip2"
15 changes: 15 additions & 0 deletions wasm-components/rust/.zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"cargo": {
"target": "wasm32-wasip2"
}
}
}
}
}
Loading

0 comments on commit 18d9d35

Please sign in to comment.