Skip to content

Commit

Permalink
Use WASM for 32 bit builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sergv committed Dec 15, 2024
1 parent c4dc738 commit d7e4412
Showing 1 changed file with 34 additions and 39 deletions.
73 changes: 34 additions & 39 deletions .github/workflows/haskell-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,61 +87,56 @@ jobs:
cabal test --project-file "$project_file" --constraint "atomic-counter +no-cmm" --test-show-details=direct all
cabal bench --project-file "$project_file" --constraint "atomic-counter +no-cmm" --benchmark-options='--stdev 100 --timeout 100' all
i386:
wasi:
runs-on: ubuntu-latest
container:
image: i386/ubuntu:bionic

env:
GHC_WASM_META_REV: a04cc1a2206d2030326e1d49be9c6a94ee4283a3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc:
- "8.6"
- "8.8"
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"

ghc: ['9.10']
fail-fast: false
steps:
- name: Install
run: |
apt-get update -y
apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl libncurses5 libtinfo5 libncurses5-dev libtinfo-dev

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh
- name: setup-ghc-wasm32-wasi
run: |
cd $(mktemp -d)
curl -L https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/$GHC_WASM_META_REV/ghc-wasm-meta.tar.gz | tar xz --strip-components=1
./setup.sh
~/.ghc-wasm/add_to_github_path.sh
env:
FLAVOUR: ${{ matrix.ghc }}

source ~/.ghcup/env
ghcup install ghc --set ${{ matrix.ghc }}
ghcup install cabal latest
- uses: actions/checkout@v4

# This version must stay old enough to remain compatible with the container image.
- uses: actions/checkout@v1
- uses: actions/cache@v4
with:
path: ~/.ghc-wasm/.cabal/store
key: wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}-

- name: Cabal version
run: |
source ~/.ghcup/env
cabal --version
- name: Unpack
run: |
source ~/.ghcup/env
cabal update
cabal sdist --ignore-project --output-directory ..
wasm32-wasi-cabal sdist --ignore-project --output-directory ..
cd ..
cabal get atomic-counter-*.tar.gz -d default
wasm32-wasi-cabal get atomic-counter-*.tar.gz -d default
wasm32-wasi-cabal get atomic-counter-*.tar.gz -d no-cmm
- name: Build & Test default
run: |
source ~/.ghcup/env
cabal update
project_file="$(pwd)/cabal.project.ci"
cd ../default/atomic-counter-*/
cabal build --project-file "$project_file" all
cabal test --project-file "$project_file" --test-show-details=direct all
wasm32-wasi-cabal build --project-file "$project_file" all
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" test:atomic-counter:test)
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" bench:atomic-counter:bench) --stdev 100 --timeout 100
- name: Build & Test no cmm
run: |
project_file="$(pwd)/cabal.project.ci"
cd ../no-cmm/atomic-counter-*/
wasm32-wasi-cabal build --project-file "$project_file" --constraint "atomic-counter +no-cmm" all
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" test:atomic-counter:test)
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" bench:atomic-counter:bench) --stdev 100 --timeout 100
cabal bench --project-file "$project_file" --benchmark-options='--stdev 100 --timeout 100' all

0 comments on commit d7e4412

Please sign in to comment.