Skip to content

ci: add wasi-sdk to path #11

ci: add wasi-sdk to path

ci: add wasi-sdk to path #11

Workflow file for this run

name: Test JavaScript Samples
on:
pull_request:
push:
branches:
- main
- ci
env:
GITHUB_TOKEN: ${{ github.token }}
TEST_SUITE_DIR: ./test-suite
TESTS_BUILDER_DIR: ./test-suite/js-test-app
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "16"
- name: Download WASI SDK
run: |
curl -L -o wasi-sdk.tar.gz https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz
- name: Extract WASI SDK
run: |
mkdir wasi-sdk
tar -xzf wasi-sdk.tar.gz -C wasi-sdk --strip-components=1
pwd
- name: Add WASI SDK to PATH
run: |
echo "/home/runner/work/winterjs/winterjs/wasi-sdk/bin" >> $GITHUB_PATH
- name: Setup Rust
uses: dsherret/rust-toolchain-file@v1
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install WinterJS
run: cargo install wasmer-winter --path . --locked
- name: Install Wrangler globally
run: pnpm install -g wrangler
- name: Build the tests
working-directory: ${{ env.TESTS_BUILDER_DIR }}
run: |
pnpm install
pnpm run build
- name: Run the tests
working-directory: ${{ env.TEST_SUITE_DIR }}
run: |
cargo run