Commit e919c7db authored by Cheng Shao's avatar Cheng Shao Committed by Bodigrim
Browse files

Improve test

parent 42034463
......@@ -6,64 +6,24 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: setup-wasi-sdk
- name: setup-ghc-wasm32-wasi
run: |
pushd $(mktemp -d)
curl -L https://nightly.link/WebAssembly/wasi-sdk/workflows/main/main/dist-ubuntu-latest.zip -O
unzip dist-ubuntu-latest.zip
sudo mkdir /opt/wasi-sdk
sudo tar xzf wasi-sdk-*.tar.gz --strip-components=1 -C /opt/wasi-sdk
curl -L https://github.com/tweag/ghc-wasm32-wasi/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
./setup.sh
~/.ghc-wasm32-wasi/add_to_github_path.sh
popd
- name: setup-libffi
run: |
pushd $(mktemp -d)
curl -L https://nightly.link/tweag/libffi-wasm32/workflows/shell/master/out.zip -O
unzip out.zip
sudo cp include/* /opt/wasi-sdk/share/wasi-sysroot/include
sudo cp lib/* /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi
popd
- name: setup-ghc
run: |
sudo mkdir /opt/ghc-wasm32-wasi
pushd /opt/ghc-wasm32-wasi
curl -L https://gitlab.haskell.org/TerrorJack/ghc/-/jobs/artifacts/wasm32-wasi/raw/ghc-wasm32-wasi.tar.xz?job=wasm32-wasi-bindist | sudo tar xJ --strip-components=1
sudo ./configure \
--host=x86_64-linux \
--target=wasm32-wasi \
AR=/opt/wasi-sdk/bin/llvm-ar \
CC=/opt/wasi-sdk/bin/clang \
LD=/opt/wasi-sdk/bin/wasm-ld \
LLC=/bin/false \
OPT=/bin/false \
RANLIB=/opt/wasi-sdk/bin/llvm-ranlib \
STRIP=/opt/wasi-sdk/bin/llvm-strip \
CONF_CC_OPTS_STAGE2="-O3 -mmutable-globals -mnontrapping-fptoint -mreference-types -msign-ext" \
CONF_CXX_OPTS_STAGE2="-O3 -mmutable-globals -mnontrapping-fptoint -mreference-types -msign-ext" \
CONF_GCC_LINKER_OPTS_STAGE2="-Wno-unused-command-line-argument -Wl,--error-limit=0,--growable-table,--stack-first"
sudo make lib/settings
sudo bin/wasm32-wasi-ghc-pkg recache
popd
/opt/ghc-wasm32-wasi/bin/wasm32-wasi-ghc --info
- name: setup-cabal
run: |
echo "CABAL_DIR=$HOME/.cabal-wasm32-wasi" >> $GITHUB_ENV
export CABAL_DIR=$HOME/.cabal-wasm32-wasi
mkdir $CABAL_DIR
cp cabal.config.wasm32-wasi $CABAL_DIR/config
- uses: actions/checkout@v3
- name: test
run: |
cp /opt/wasi-sdk/share/misc/config.* .
cp ~/.ghc-wasm32-wasi/wasi-sdk/share/misc/config.* .
autoreconf -i
cabal --project-file=cabal.project.wasm32-wasi build
wasm32-wasi-cabal --project-file=cabal.project.wasm32-wasi build
./test-wasm32-wasi.mjs
repository hackage.haskell.org
url: https://hackage.haskell.org/
secure: True
root-keys:
0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d
1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42
280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833
2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201
2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3
51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921
772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d
aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9
fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0
key-threshold: 3
library-vanilla: True
shared: False
executable-dynamic: False
profiling: False
optimization: 2
debug-info: False
library-for-ghci: False
split-sections: False
split-objs: False
executable-stripping: False
library-stripping: False
user-install: False
tests: False
coverage: False
benchmarks: False
relocatable: True
write-ghc-environment-files: always
documentation: False
minimize-conflict-set: True
jobs: $ncpus
program-default-options
hsc2hs-options: --cross-compile
with-compiler: /opt/ghc-wasm32-wasi/bin/wasm32-wasi-ghc
with-hc-pkg: /opt/ghc-wasm32-wasi/bin/wasm32-wasi-ghc-pkg
program-locations
hsc2hs-location: /opt/ghc-wasm32-wasi/bin/wasm32-wasi-hsc2hs
......@@ -2,3 +2,5 @@ packages: .
package unix
ghc-options: -Wno-unused-imports
write-ghc-environment-files: always
......@@ -14,7 +14,7 @@ for (const f of await fs.promises.readdir("tests")) {
// Compile the test case
console.log(`\n${f}`);
const r = await my_execFile("/opt/ghc-wasm32-wasi/bin/wasm32-wasi-ghc", [
const r = await my_execFile("wasm32-wasi-ghc", [
`tests/${f}`,
"-Wno-deprecations",
"-optl-Wl,--warn-unresolved-symbols",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment