Skip to content

Commit

Permalink
Create test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored Feb 20, 2024
1 parent daf2e16 commit 7a2cc78
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Test `main`"

env:
WASI_SDK_PATH: /opt/wasi-sdk
WASI_SDK_VERSION: "20"
WASMTIME_VERSION: "14.x"

on:
- workflow_dispatch

jobs:
test-main:
runs-on: ubuntu-latest
steps:
# TODO: cache installation somehow
- name: "Install WASI SDK ${{ env.WASI_SDK_VERSION }}"
run: |
mkdir ${{ env.WASI_SDK_PATH }} && \
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz | \
tar --strip-components 1 --directory ${{ env.WASI_SDK_PATH }} --extract --gunzip
$WASI_SDK_PATH/bin/clang --version
- name: "Install wasmtime ${{ env.WASMTIME_VERSION }}"
uses: jcbhmr/setup-wasmtime@v2
with:
wasmtime-version: ${{ env.WASMTIME_VERSION }}
- name: "Install Python"
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: "Checkout CPython"
uses: actions/checkout@v3
with:
repository: "python/cpython"
- name: "Configure the build python"
run: python3 Tools/wasm/wasi.py configure-build-python -- --with-pydebug
- name: "Make the build python"
run: python3 Tools/wasm/wasi.py make-build-python
- name: "Configure the host"
run: python3 Tools/wasm/wasi.py configure-host
- name: "Make the host"
run: python3 Tools/wasm/wasi.py make-host
- name: "Run tests"
run: make --directory cross-build/wasm32-wasi/ test

0 comments on commit 7a2cc78

Please sign in to comment.