Skip to content

chore: refractor

chore: refractor #22

Workflow file for this run

name: Test
on:
push:
paths:
- '**.py'
- ".github/workflows/*.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.py'
- ".github/workflows/*.yml"
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
# Set this option if you want the action to check for the latest available version that satisfies the version spec.
# check-latest: # optional
- name: Install requirements
run: |
pip install -r requirements.txt
sudo apt update && sudo apt install graphviz
- name: Cache wabt
id: cache-wabt
uses: actions/cache@v4
with:
path: wabt-1.0.32
key: wabt
- name: Install wabt
if: steps.cache-wabt.outputs.cache-hit != 'true'
run: |
curl -JLO "https://github.com/WebAssembly/wabt/releases/download/1.0.32/wabt-1.0.32-ubuntu.tar.gz"
tar xzf wabt-1.0.32-ubuntu.tar.gz
- name: Cache wasi-sdk
id: cache-wasi-sdk
uses: actions/cache@v4
with:
path: wasi-sdk-22.0
key: wasi-sdk
- name: Install wasi-sdk
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
run: |
curl -JLO "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz"
tar xzf wasi-sdk-22.0-linux.tar.gz
- name: Cache wasmtime
id: cache-wasmtime
uses: actions/cache@v4
with:
path: ~/.wasmtime
key: wasmtime
- name: Install wasmtime
if: steps.cache-wasmtime.outputs.cache-hit != 'true'
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup target add wasm32-wasi
- uses: actions/setup-go@v5
with:
go-version: 1.22
check-latest: true
cache: true
- name: Install tinygo
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.32.0/tinygo_0.32.0_amd64.deb
sudo dpkg -i tinygo_0.32.0_amd64.deb
- name: Run pytest
run: |
export PATH=$(pwd)/wabt-1.0.32/bin:$PATH
export PATH=$(pwd)/wasi-sdk-22.0/bin:$PATH
export PATH=$(pwd)/.cargo/bin:$PATH
export PATH=$(pwd)/.wasmtime/bin:$PATH
pytest test.py --tb=short --durations=0
pytest test/test_linux.py --tb=short --durations=0