Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JS CI, fixes #291 #337

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: ci-js

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-20.04
env:
GHC: 9.10.0.20240413
EMSDK: 3.1.57
steps:
- name: Install GHCup
id: ghcup
uses: haskell/ghcup-setup@v1
with:
cabal: latest-prerelease
config: |
url-source:
- GHCupURL
- cross
- prereleases

- uses: actions/checkout@v4

- name: setup GHCJS
run: |
set -eux
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout ${{ env.EMSDK }}
./emsdk install ${{ env.EMSDK }}
./emsdk activate ${{ env.EMSDK }}
source ./emsdk_env.sh
emconfigure ghcup install ghc --set javascript-unknown-ghcjs-${{ env.GHC }}

- name: test
run: |
set -eux

source ./emsdk/emsdk_env.sh
autoreconf -i
cabal update

cabal --project-file=cabal.project.js build --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs
$(cabal --project-file=cabal.project.js list-bin T13660)
$(cabal --project-file=cabal.project.js list-bin unix-tests)

18 changes: 18 additions & 0 deletions cabal.project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
packages: .

with-compiler: javascript-unknown-ghcjs-ghc
with-hc-pkg: javascript-unknown-ghcjs-ghc-pkg

package unix
ghc-options: -Wno-unused-imports

write-ghc-environment-files: always

allow-newer: all:base

tests: True

constraints:
random < 1.2,
tasty -unix, optparse-applicative -process,
unix -os-string
Loading