File tree Expand file tree Collapse file tree
packages/cli/src/lib/defaults/build-strategies/wasm/rust Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 github.event.pull_request.merged &&
1212 endsWith(github.event.pull_request.title, '/workflows/cd-containers') &&
1313 github.event.pull_request.user.login != 'polywrap-build-bot'
14- runs-on : ubuntu-20.04
14+ runs-on : ubuntu-latest
1515 steps :
1616 - name : Checkout
1717 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1+ name : CI-Containers
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - " packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/Dockerfile"
7+ - " packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/Dockerfile"
8+
9+ jobs :
10+ Build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v2
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v2
18+
19+ - name : Cache Image Directories
20+ run : |
21+ echo IMAGE_RS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm >> $GITHUB_ENV
22+ echo IMAGE_AS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm >> $GITHUB_ENV
23+
24+ - name : Build RS VM Image
25+ working-directory : ${{env.IMAGE_RS_VM_DIR}}
26+ run : |
27+ docker buildx build . --platform=linux/amd64,linux/arm64
28+
29+ - name : Build AS VM Image
30+ working-directory : ${{env.IMAGE_AS_VM_DIR}}
31+ run : |
32+ docker buildx build . --platform=linux/amd64,linux/arm64
Original file line number Diff line number Diff line change 1- FROM rust:1.66 -alpine as base
1+ FROM rust:1.70 -alpine as base
22
33# Install the wasm32 rust build target
44RUN rustup target add wasm32-unknown-unknown
@@ -12,19 +12,22 @@ RUN apk add curl pkgconfig openssl-dev bash
1212RUN apk add clang llvm build-base
1313
1414# Install wasm-opt
15- RUN cargo install wasm-opt
16-
17- # Install the toml-cli
18- RUN cargo install toml-cli
15+ RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
16+ && chmod +x binaryen-version_101/bin/wasm-opt \
17+ && cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
18+ && rm -rf binary-version_101
1919
2020# Install wasm-snip
2121RUN cargo install wasm-snip
2222
23+ # Install wasm-tools
24+ RUN cargo install wasm-tools
25+
2326# Install wasm-bindgen
2427RUN cargo install wasm-bindgen-cli
2528
26- # Install wasm-tools
27- RUN cargo install wasm-tools
29+ # Install the toml-cli
30+ RUN cargo install toml-cli
2831
2932# Install cargo-build-deps
3033RUN cargo install cargo-build-deps
Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ cargo install wasm-bindgen-cli
1515# Install wasm-tools
1616cargo install wasm-tools
1717
18- # Install wasm-opt
19- cargo install wasm-opt
20-
2118# Ensure the module at {{dir}} has the crate-type = ["cdylib"]
2219toml set " $1 " /Cargo.toml lib.crate-type [" cdylib" ] > " $1 " /Cargo-local.toml && \
2320 mv " $1 " /Cargo.toml " $1 " /Cargo-bak.toml && \
Original file line number Diff line number Diff line change 1- FROM rust:1.66 -alpine as base
1+ FROM rust:1.70 -alpine as base
22
33# Install the wasm32 rust build target
44RUN rustup target add wasm32-unknown-unknown
@@ -12,22 +12,22 @@ RUN apk add curl pkgconfig openssl-dev bash
1212RUN apk add clang llvm build-base
1313
1414# Install wasm-opt
15- RUN cargo install wasm-opt
16-
17- # Install the toml-cli
18- RUN cargo install toml-cli
15+ RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
16+ && chmod +x binaryen-version_101/bin/wasm-opt \
17+ && cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
18+ && rm -rf binary-version_101
1919
2020# Install wasm-snip
2121RUN cargo install wasm-snip
2222
23- # Install wasm-bindgen
24- RUN cargo install wasm-bindgen-cli
25-
2623# Install wasm-tools
2724RUN cargo install wasm-tools
2825
29- # Install cargo-build-deps
30- RUN cargo install cargo-build-deps
26+ # Install wasm-bindgen
27+ RUN cargo install wasm-bindgen-cli
28+
29+ # Install the toml-cli
30+ RUN cargo install toml-cli
3131
3232# Ensure the Wasm module is configured to use imported memory
3333ENV RUSTFLAGS="-C link-arg=-z -C link-arg=stack-size=65536 -C link-arg=--import-memory"
You can’t perform that action at this time.
0 commit comments