mirror of
https://github.com/extism/extism.git
synced 2026-01-08 21:38:13 -05:00
ci: automate PRs to build canonical version of extism-runtime.wasm (#473)
Closes #469 This PR adds a github workflow that is triggered by updates to the `kernel/` directory or `runtime/src/extism-kernel.wasm` - it builds the kernel, including using `wasm-strip` and makes a PR against any PR that has a kernel module that doesn't match the expected output. I had considered making this run when the PR is merged into main, but this approach gives us a chance to run CI with the generated wasm file. I think automatically adding a commit would be simpler, but this way seems more transparent. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: zshipko <zshipko@users.noreply.github.com>
This commit is contained in:
44
.github/workflows/kernel.yml
vendored
Normal file
44
.github/workflows/kernel.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- kernel/**
|
||||||
|
|
||||||
|
name: Kernel
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
kernel:
|
||||||
|
name: Build extism-runtime.wasm
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
target: wasm32-unknown-unknown
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
sudo apt install wabt --yes
|
||||||
|
|
||||||
|
- name: Build kernel
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd kernel
|
||||||
|
sh build.sh
|
||||||
|
|
||||||
|
- uses: peter-evans/create-pull-request@v5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
title: "update(kernel): extism-runtime.wasm in ${{ github.event.pull_request.head.ref }}"
|
||||||
|
body: "Automated PR to update `runtime/src/extism-runtime.wasm` in PR #${{ github.event.number }}"
|
||||||
|
base: "${{ github.event.pull_request.head.ref }}"
|
||||||
|
branch: "update-kernel--${{ github.event.pull_request.head.ref }}"
|
||||||
|
add-paths: "runtime/src/extism-runtime.wasm"
|
||||||
|
commit-message: "update(kernel): extism-runtime.wasm in ${{ github.event.pull_request.head.ref }}"
|
||||||
|
delete-branch: true
|
||||||
4
kernel/rust-toolchain.toml
Normal file
4
kernel/rust-toolchain.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "stable"
|
||||||
|
components = [ "rustfmt", "rust-std" ]
|
||||||
|
targets = [ "wasm32-unknown-unknown" ]
|
||||||
Binary file not shown.
Reference in New Issue
Block a user