-
-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows us to deprecate GHCJS 8.4 (which makes sense, as vanilla GHC < 8.6 is already deprecated). We re-use GHCJS from reflex-platform, which unfortunately isn't up-to-date with latest GHC and is only 8.6. The benefit of using reflex-platform is that it provides nix expressions for GHCJS + a binary nix cache. reflex-platform patches text to use a JS-String based internal representation for performance reasons, so we provide a few haskell dependencies from reflex-platform as well: - hashable - attoparsec As those rely on text's internal representation but have been patched for reflex-platform.
- Loading branch information
Gaël Deest
committed
Oct 10, 2021
1 parent
48bc247
commit 910a3ae
Showing
6 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# cabal v2-test does not work with GHCJS | ||
# See: https://github.com/haskell/cabal/issues/6175 | ||
# | ||
# This invokes cabal-plan to figure out test binaries, and invokes them with node. | ||
|
||
cabal-plan list-bins '*:test:*' | while read -r line | ||
do | ||
testpkg=$(echo "$line" | perl -pe 's/:.*//') | ||
testexe=$(echo "$line" | awk '{ print $2 }') | ||
echo "testing $textexe in package $textpkg" | ||
(cd "$testpkg" && node "$testexe".jsexe/all.js) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,8 +172,40 @@ jobs: | |
- name: Run tests | ||
run: | | ||
# cabal v2-test does not work with GHCJS | ||
# See: https://github.com/haskell/cabal/issues/6175 | ||
# | ||
# This invokes cabal-plan to figure out test binaries, and invokes them with node. | ||
cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done | ||
ghcjs-test: | ||
name: ghcjs-test | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v13 | ||
with: | ||
extra_nix_config: | | ||
trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/ | ||
- name: Setup | ||
run: | | ||
# Override cabal.project with the lightweight GHCJS one | ||
cp cabal.ghcjs.project cabal.project | ||
cat cabal.project | ||
nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze" | ||
- uses: actions/[email protected] | ||
name: Cache ~/.cabal/store and dist-newstyle | ||
with: | ||
path: | | ||
~/.cabal/store | ||
dist-newstyle | ||
key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }} | ||
restore-keys: | | ||
${{ runner.os }}-ghcjs8.6- | ||
- name: Build | ||
run: | | ||
nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all" | ||
- name: Tests | ||
run: | | ||
nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
let reflex-platform = import (builtins.fetchTarball | ||
{ name = "reflex-platform"; | ||
url = "https://github.com/reflex-frp/reflex-platform/archive/1aba6f367982bd6dd78ec2fda75ab246a62d32c5.tar.gz"; | ||
}) {}; | ||
pkgs = import ./nix/nixpkgs.nix; in | ||
|
||
pkgs.stdenv.mkDerivation { | ||
name = "ghcjs-shell"; | ||
buildInputs = | ||
[ (reflex-platform.ghcjs.ghcWithPackages (p: with p; [ | ||
attoparsec | ||
hashable | ||
])) | ||
pkgs.cabal-install | ||
pkgs.gmp | ||
pkgs.haskellPackages.cabal-plan | ||
pkgs.haskellPackages.hspec-discover | ||
pkgs.nodejs | ||
pkgs.perl | ||
pkgs.zlib | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import (builtins.fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz"; | ||
sha256 = "sha256:1ckzhh24mgz6jd1xhfgx0i9mijk6xjqxwsshnvq789xsavrmsc36"; | ||
}) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters