Skip to content

Commit

Permalink
feat(wasm-smith): sync with upstream (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on authored Oct 17, 2023
1 parent 9942645 commit 632359d
Show file tree
Hide file tree
Showing 4,259 changed files with 176,066 additions and 22,624 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build
on:
push:
tags:
pull_request:
branches:
- main

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
name: Build wasm-tools
runs-on: ${{ matrix.os }}
if: github.event_name != 'push' || startsWith(github.ref, 'refs/tags/wasm-tools-')
strategy:
matrix:
include:
- build: x86_64-linux
os: ubuntu-latest
- build: x86_64-macos
os: macos-latest
- build: aarch64-macos
os: macos-latest
target: aarch64-apple-darwin
- build: x86_64-windows
os: windows-latest
- build: aarch64-linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: rustup update stable --no-self-update && rustup default stable
- uses: bytecodealliance/wasmtime/.github/actions/[email protected]
with:
name: ${{ matrix.build }}
- run: |
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
rustup target add ${{ matrix.target }}
if: matrix.target != ''
- run: $CENTOS cargo build --release
- run: ./ci/build-tarballs.sh "${{ matrix.build }}" "${{ matrix.target }}"
- uses: actions/upload-artifact@v3
with:
name: bins-${{ matrix.build }}
path: dist

- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'bytecodealliance/wasm-tools'
with:
files: "dist/*"
54 changes: 44 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,72 @@ jobs:
os: windows-latest
rust: stable
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- run: cargo test --all
- run: cargo test --manifest-path crates/wasmparser/Cargo.toml --features deterministic
- run: cargo test -p wasmparser --benches
- run: cargo test --locked --all
- run: cargo test --locked -p wasmparser --benches
- run: cargo test --locked -p wasm-encoder --all-features
- run: cargo build --manifest-path crates/wast/Cargo.toml --no-default-features
- run: cargo build --manifest-path crates/wast/Cargo.toml --no-default-features --features wasm-module
- run: cmake -S ${{github.workspace}}/examples -B ${{github.workspace}}/examples/build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build ${{github.workspace}}/examples/build --config Release

wasm:
name: Test on WebAssembly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable
- run: rustup target add wasm32-wasi
- run: |
tag=v10.0.1
curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/${tag}/wasmtime-${tag}-x86_64-linux.tar.xz
tar xf wasmtime-${tag}-x86_64-linux.tar.xz
echo `pwd`/wasmtime-${tag}-x86_64-linux >> $GITHUB_PATH
echo CARGO_TARGET_WASM32_WASI_RUNNER='wasmtime run --dir . --' >> $GITHUB_ENV
echo CARGO_BUILD_TARGET='wasm32-wasi' >> $GITHUB_ENV
- run: |
cargo --locked test --workspace \
--exclude fuzz-stats \
--exclude wasm-tools-fuzz \
--exclude wasm-mutate-stats
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
# Note that this doesn't use `cargo fmt` because that doesn't format
# modules-defined-in-macros which is in use in `wast` for example. This is
# the best alternative I can come up with at this time
- run: find . -name '*.rs' | xargs rustfmt --check --edition 2021

fuzz:
name: Fuzz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo install cargo-fuzz
- run: cargo fuzz build
- run: cargo fuzz build --dev -s none
- run: cargo fuzz build --dev --features wasmtime -s none

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: cargo check --benches -p wasm-smith
- run: cargo check --no-default-features
- run: cargo check --no-default-features --features print
Expand All @@ -84,9 +111,16 @@ jobs:
- run: cargo check --no-default-features --features mutate
- run: cargo check --no-default-features --features dump
- run: cargo check --no-default-features --features objdump
- run: cargo check --no-default-features --features strip
- run: cargo check --no-default-features --features compose
- run: cargo check --no-default-features --features demangle
- run: cargo check --no-default-features --features component
- run: cargo check --no-default-features --features metadata
- run: cargo check --no-default-features --features wit-smith
- run: cargo check --no-default-features --features addr2line

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: cargo doc --all
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
target/
Cargo.lock
publish

# Generated by some fuzz targets.
*.wasm
*.wat
test.config

Loading

0 comments on commit 632359d

Please sign in to comment.