Skip to content

Add wasi-otel wash-runtime plugin #910

Add wasi-otel wash-runtime plugin

Add wasi-otel wash-runtime plugin #910

Workflow file for this run

name: wash
on:
pull_request:
branches:
- main
paths:
- ".github/workflows/wash.yml"
- "crates/**"
- "src/**"
- "tests/**"
- "Cargo.*"
- "rust-toolchain.toml"
- "rustfmt.toml"
push:
branches:
- main
tags:
- "wash-v*"
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Remove unused files
if: ${{ matrix.os == 'ubuntu-latest' }}
# based on https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg
run: |
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/julia*
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /opt/microsoft /opt/google
sudo rm -rf /opt/az
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /opt/hostedtoolcache
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: "22"
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: "^1.25.0"
cache: false
- name: Setup TinyGo
uses: acifani/setup-tinygo@b2ba42b249c7d3efdfe94166ec0f48b3191404f7 # v2.0.0
with:
tinygo-version: "0.39.0"
- name: Setup wasm-tools
uses: bytecodealliance/actions/wasm-tools/setup@d742827944dcb656569399571a8a45261b5089f6 # v1.1.0
with:
version: "1.223.1"
- name: Setup protoc
uses: arduino/setup-protoc@f4d5893b897028ff5739576ea0409746887fa536 # v3.0.0
with:
version: "29.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Build
run: cargo build
- name: Test
env:
RUST_BACKTRACE: "1"
run: |
cargo test --workspace
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup protoc
uses: arduino/setup-protoc@f4d5893b897028ff5739576ea0409746887fa536 # v3.0.0
with:
version: "29.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
rust-toolchain: nightly
rust-components: rustfmt
- name: Install cargo-machete
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
with:
tool: cargo-machete@0.8.0
- name: Format
run: |
cargo +nightly fmt -- --check
- name: Lint
run: |
cargo clippy --workspace
- name: Check for unused dependencies
run: |
cargo machete
canary:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
packages: write
uses: ./.github/workflows/docker-build-push.yml
secrets: inherit
with:
push: true
image: ghcr.io/wasmcloud/wash
tags: |
type=raw,value=canary-v2
docker-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/wash-v')
permissions:
contents: write
packages: write
uses: ./.github/workflows/docker-build-push.yml
secrets: inherit
with:
push: true
image: ghcr.io/wasmcloud/wash
tags: |
type=match,pattern=wash-v(.*),group=1
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/wash-v')
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
buildCommand: cargo zigbuild
artifact: wash-x86_64-unknown-linux-musl
runner: ubuntu-latest
bin: wash
- target: aarch64-unknown-linux-musl
buildCommand: cargo zigbuild
artifact: wash-aarch64-unknown-linux-musl
runner: ubuntu-latest
bin: wash
- target: x86_64-apple-darwin
buildCommand: cargo build
artifact: wash-x86_64-apple-darwin
runner: macos-15-intel
bin: wash
- target: aarch64-apple-darwin
buildCommand: cargo build
artifact: wash-aarch64-apple-darwin
runner: macos-latest
bin: wash
- target: x86_64-pc-windows-msvc
buildCommand: cargo build
artifact: wash-x86_64-pc-windows-msvc
runner: windows-latest
bin: wash.exe
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
rust-toolchain: stable
# Only needed for ubuntu
install-zigbuild: ${{ matrix.runner == 'ubuntu-latest' }}
rust-targets: "${{ matrix.target }}"
- name: Setup protoc
uses: arduino/setup-protoc@f4d5893b897028ff5739576ea0409746887fa536 # v3.0.0
with:
version: "29.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build binary (${{ matrix.target }})
run: |
${{ matrix.buildCommand }} --release --target ${{ matrix.target }}
cp target/${{ matrix.target }}/release/${{ matrix.bin }} ${{ matrix.artifact }}
- name: Upload artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
if-no-files-found: error
upload-release-assets:
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Download all artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: ./artifacts
pattern: wash-*
- name: Generate build provenance attestations
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: "./artifacts/*/wash*"
- name: Create GitHub Release and upload binaries
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: |
./artifacts/*/*
token: ${{ github.token }}
prerelease: false
generate_release_notes: true