Skip to content

Commit 2f4f1cf

Browse files
committed
Add playwright test to CI
1 parent 4a2451b commit 2f4f1cf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/haskell-wasm.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@ jobs:
142142
run: |
143143
wasm32-wasi-cabal build cardano-wasm --no-semaphore -j1 --ghc-options="-j1"
144144
145+
- name: Prepare example
146+
run: |
147+
cp $(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1) cardano-wasm/example/
148+
$(wasm32-wasi-ghc --print-libdir)/post-link.mjs -i "$(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1)" -o cardano-wasm/example/cardano-wasm.js
149+
cp cardano-wasm/lib-wrapper/* cardano-wasm/example/
150+
151+
- uses: rrbutani/use-nix-shell-action@v1
152+
with:
153+
devShell: .#playwright
154+
155+
- name: Run playwright test in example
156+
run: |
157+
httpserver -h localhost -a 127.0.0.1 -p 8080 cardano-wasm/example &
158+
playwright test cardano-wasm/js-test/basic-test.spec.ts
159+
145160
# - name: Run tests
146161
# env:
147162
# TMPDIR: ${{ runner.temp }}

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@
213213
playwright = playwright-pkgs.mkShell {
214214
packages = [
215215
playwright-pkgs.playwright-test
216+
playwright-pkgs.python313Packages.docopt
217+
playwright-pkgs.python313Packages.httpserver
216218
];
217219
};
218220
};

0 commit comments

Comments
 (0)