Skip to content

fix: Specify the exact version of Rust 1.56.0 #652

fix: Specify the exact version of Rust 1.56.0

fix: Specify the exact version of Rust 1.56.0 #652

Workflow file for this run

# CI workflow
name: test
on: [push, pull_request]
env:
# Rust equivalent of -Werror
RUSTFLAGS: --deny warnings
# used during LLVM installation
LLVM_VERSION: 13
WASI_SDK_VERSION: 12
# URLs for WebAssembly libcs
LIBUV_URL: https://github.com/libuv/libuv/archive/refs/tags/v1.42.0.tar.gz
UVWASI_URL: https://github.com/nodejs/uvwasi/archive/refs/tags/v0.0.11.tar.gz
# Used by Makefiles that compile *.c to *.wasm
WASI_SDK_PATH: /opt/wasi-sdk/
# job control
jobs:
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Rust 1.56.0
run: |
rustup default 1.56.0
rustup component add rustfmt
rustup update
cargo --version
- name: Install Clang Format
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main"
sudo apt update
sudo apt install clang-format-$LLVM_VERSION --yes
sudo update-alternatives --remove-all clang-format
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-$LLVM_VERSION 100
- name: Run Clang Format check
run: ./format.sh -d
- name: Run Cargo Format check
run: cargo fmt -- --check
test:
runs-on: ubuntu-20.04
if: always()
strategy:
matrix:
libc: [wasmception, wasi-sdk]
steps:
- uses: actions/checkout@v2
- name: Install Rust 1.56.0
run: |
rustup default 1.56.0
rustup update
cargo --version
- name: Install LLVM
run: |
sudo apt install binaryen --yes
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-$LLVM_VERSION 100
sudo apt install libc++-dev libc++abi-dev wabt --yes
# not really sure why we need to modify this
PATH=/usr/bin:$PATH
llvm-config --version
- name: Get wasmception
if: matrix.libc == 'wasmception'
run: |
WASMCEPTION_URL=https://github.com/gwsystems/wasmception/releases/download/v0.2.0/wasmception-linux-x86_64-0.2.0.tar.gz
wget $WASMCEPTION_URL -O wasmception.tar.gz
mkdir -p wasmception
tar xvfz wasmception.tar.gz -C wasmception
- name: Get wasi-sdk
if: matrix.libc == 'wasi-sdk'
run: |
WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sdk-$WASI_SDK_VERSION.0-linux.tar.gz
wget $WASI_SDK_URL -O wasi-sdk.tar.gz
mkdir -p /opt/wasi-sdk
tar xvfz wasi-sdk.tar.gz --strip-components=1 -C /opt/wasi-sdk
- name: Install runtime dependencies (libuv, uvwasi)
if: matrix.libc == 'wasi-sdk'
run: |
make -C ./runtime/thirdparty install
- name: Compile awsm
run: |
cargo --version
cargo build --release
- name: Preliminary tests
# note we skip code_benches; we run code_benches/run.py ourselves
# to pass explicit flags
run: |
cargo test -- --skip code_benches
# These tests assume WASI
- name: WebAssembly Specification Test Suite (uvwasi)
if: matrix.libc == 'wasi-sdk'
run: |
cd tests/wat && ./run.sh uvwasi
- name: WebAssembly Specification Test Suite (minimal)
if: matrix.libc == 'wasi-sdk'
run: |
cd tests/wat && ./run.sh minimal
- name: WebAssembly Specification Test Suite (wasmception)
if: matrix.libc == 'wasmception'
run: |
cd tests/wat && ./run.sh wasmception
- name: WASI Tests
if: matrix.libc == 'wasi-sdk'
run: |
make -C tests/wasi all
cd tests/wasi && bash ./run.sh
- name: Code benches
run: |
./code_benches/run.py --debug --${{matrix.libc}} -o benchmarks.csv
- name: Results
run: cat benchmarks.csv
- uses: actions/upload-artifact@v2
with:
name: ${{matrix.libc}}-benchmarks
path: benchmarks.csv