difftreelog
ci build wasm on ci
in: master
6 files changed
.gitignorediffbeforeafterboth--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@
.idea
.vscode
+
+cache
.gitlab-ci.ymldiffbeforeafterbothMakefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,7 @@
-jsonnet-cpp:
- git clone https://github.com/google/jsonnet jsonnet-cpp
-
-.ONESHELL:
-test-examples: jsonnet-cpp
- cargo build --release
- export JSONNET_BIN="$(PWD)/target/release/jsonnet"
- export EXAMPLES_DIR="$(PWD)/jsonnet-cpp/examples/"
- cd ./jsonnet-cpp/examples/
- ./check.sh
+.PHONY: test build build-wasi
+test:
+ cargo test
+build:
+ RUSTFLAGS="-Zmutable-noalias=yes -C link-arg=-s" cargo build --release -p jrsonnet
+build-wasi:
+ cd ./bindings/ && cargo build --release -p jsonnet --target wasm32-wasi
build/Dockerfilediffbeforeafterboth--- /dev/null
+++ b/build/Dockerfile
@@ -0,0 +1,12 @@
+FROM alpine:edge
+
+RUN apk add --no-cache \
+ gcc \
+ make \
+ g++ \
+ curl \
+ cmake \
+ clang \
+ linux-headers
+RUN apk add --no-cache rustup && rustup-init --default-toolchain nightly -y -t wasm32-wasi
+ENV PATH /root/.rustup/toolchains/nightly-x86_64-unknown-linux-musl/bin/:/root/.cargo/bin/:${PATH}
build/make-docker.shdiffbeforeafterboth--- /dev/null
+++ b/build/make-docker.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+export DOCKER_BUILDKIT=1
+docker build -t jrsonnet -f build/Dockerfile build/
+docker run --rm -it -v $PWD:/build -e CARGO_HOME=/build/cache jrsonnet:latest ash -c "cd /build&&make $@"
build/run-docker.shdiffbeforeafterboth--- /dev/null
+++ b/build/run-docker.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+export DOCKER_BUILDKIT=1
+docker build -t jrsonnet -f build/Dockerfile build/
+docker run --rm -it -v $PWD:/build -e CARGO_HOME=/build/cache jrsonnet:latest ash -c "cd /build&&$@"