Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generated code is compared byte for byte (snapshots, include_str! runtime
# templates), so text files are LF on every platform.
* text=auto eol=lf
*.bat text eol=crlf
*.ps1 text eol=crlf
59 changes: 59 additions & 0 deletions .github/actions/toolchains/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Language toolchains
description: Install the consumer toolchain one WeaveFFI target needs (conformance and fixture checks).
inputs:
lang:
description: Target language (c, cpp, python, ruby, dart, go, swift, dotnet, node, kotlin, wasm)
required: true
runs:
using: composite
steps:
- if: inputs.lang == 'node' || inputs.lang == 'wasm'
uses: actions/setup-node@v4
with:
node-version: '22'
- if: inputs.lang == 'python'
uses: actions/setup-python@v5
with:
python-version: '3.12'
- if: inputs.lang == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- if: inputs.lang == 'ruby'
shell: bash
run: gem install ffi
# dart-lang/setup-dart can't run inside a composite action (it registers
# a problem matcher relative to the calling action), so fetch the SDK.
- if: inputs.lang == 'dart'
shell: bash
run: |
os=linux; [ "$RUNNER_OS" = macOS ] && os=macos
arch=x64; case "$(uname -m)" in arm64|aarch64) arch=arm64 ;; esac
curl -fsSL -o "$RUNNER_TEMP/dart.zip" \
"https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-$os-$arch-release.zip"
unzip -q -o "$RUNNER_TEMP/dart.zip" -d "$RUNNER_TEMP"
echo "$RUNNER_TEMP/dart-sdk/bin" >> "$GITHUB_PATH"
- if: inputs.lang == 'go'
uses: actions/setup-go@v5
with:
go-version: '1.23'
- if: inputs.lang == 'dotnet'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- if: inputs.lang == 'swift' && runner.os == 'Linux'
uses: swift-actions/setup-swift@v2
with:
swift-version: '6.0'
- if: inputs.lang == 'kotlin'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- if: inputs.lang == 'kotlin'
uses: fwilhe2/setup-kotlin@main
with:
version: '2.0.21'
- if: (inputs.lang == 'c' || inputs.lang == 'cpp') && runner.os == 'Linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang
12 changes: 6 additions & 6 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Bench

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1'

jobs:
bench:
Expand Down Expand Up @@ -31,14 +31,14 @@ jobs:
if: github.event_name == 'pull_request'
run: |
set -euo pipefail
cargo bench -p weaveffi-core --bench codegen_bench -- --test
cargo bench -p weaveffi-gen --bench codegen_bench -- --test
cargo bench -p weaveffi-cli --bench generate_bench -- --test

# Full sampled run on main; the uploaded artifact is the historical
# record of the numbers.
- name: Run cargo bench
if: github.event_name == 'push'
# The two criterion harnesses (`weaveffi-core` and `weaveffi-cli`)
# The two criterion harnesses (`weaveffi-gen` and `weaveffi-cli`)
# accept `--noplot`; the workspace `cargo bench --workspace` flag
# also fans out to the default `libtest` harness in every other
# crate, which rejects `--noplot`, so we invoke each criterion
Expand All @@ -48,7 +48,7 @@ jobs:
run: |
set -euo pipefail
{
cargo bench -p weaveffi-core --bench codegen_bench -- --noplot
cargo bench -p weaveffi-gen --bench codegen_bench -- --noplot
cargo bench -p weaveffi-cli --bench generate_bench -- --noplot
} 2>&1 | tee bench.txt

Expand Down
Loading
Loading