Skip to content

Commit

Permalink
Misc improvements (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack authored Jul 29, 2021
1 parent 5da3690 commit 0fc7444
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 149 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- macos-latest
ghc:
- ghc901
- ghc8104
- ghc8105
- ghc884
- ghc865
steps:
Expand All @@ -28,7 +28,6 @@ jobs:
- name: setup-nix
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/c9fd31e5914111602bc1ba20da875d72aba5a0f4.tar.gz
extra_nix_config: |
substituters = https://cache.nixos.org https://hydra.iohk.io
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
Expand All @@ -37,20 +36,15 @@ jobs:
uses: cachix/cachix-action@v10
with:
name: asterius
extraPullNames: niv
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: test
- name: cachix-watch-store
run: |
for node in nodejs-16_x nodejs-14_x nodejs-12_x nodejs-10_x; do
nix run --keep-going -f . -i --argstr ghc ${{ matrix.ghc }} --argstr node $node inline-js-tests.components.exes.inline-js-tests -c inline-js-tests -j2
done
cachix watch-store -c9 asterius &
- name: test-nix-shell
- name: test
run: |
for node in nodejs-16_x nodejs-14_x nodejs-12_x nodejs-10_x; do
nix-shell --keep-going --pure --argstr ghc ${{ matrix.ghc }} --argstr node $node --run "cabal v2-run inline-js-tests:inline-js-tests -- -j2"
done
nix-build --keep-going --no-out-link --argstr ghc ${{ matrix.ghc }} nix/ci.nix
cabal:
name: cabal-${{ matrix.os }}-${{ matrix.ghc }}
Expand All @@ -62,7 +56,7 @@ jobs:
- windows-latest
ghc:
- 9.0.1
- 8.10.4
- 8.10.5
- 8.8.4
- 8.6.5
steps:
Expand Down Expand Up @@ -167,8 +161,7 @@ jobs:
id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: 8.10.4
cabal-version: 3.4.0.0
ghc-version: 8.10.5

- name: cache
uses: actions/cache@v2
Expand Down Expand Up @@ -239,23 +232,8 @@ jobs:
${{ steps.setup-haskell.outputs.stack-root }}
**/.stack-work
- name: setup-node-16
uses: actions/setup-node@v2
with:
node-version: 16
check-latest: true

- name: setup-deps
run: |
npm config set prefix ~/.local
npm install -g \
netlify-cli
- name: build
run: |
export PATH=~/.local/bin:$PATH
stack build --haddock
if [ ! -z "$NETLIFY_AUTH_TOKEN" ]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Supported GHC versions:

- `ghc-8.6`, tested with `ghc-8.6.5`
- `ghc-8.8`, tested with `ghc-8.8.4`
- `ghc-8.10`, tested with `ghc-8.10.4`
- `ghc-8.10`, tested with `ghc-8.10.5`
- `ghc-9.0`, tested with `ghc-9.0.1`

Supported platforms:
Expand Down
4 changes: 3 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ packages:
inline-js-examples
inline-js-tests

tests: True

package aeson
flags: +cffi

package hashable
flags: +random-initial-seed

index-state: 2021-05-29T00:00:00Z
index-state: 2021-07-27T00:00:00Z
23 changes: 14 additions & 9 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ sources ? import ./nix/sources.nix { }
, haskellNix ? import sources.haskell-nix { }
, pkgs ? import sources.nixpkgs haskellNix.nixpkgsArgs
, ghc ? "ghc8104"
, ghc ? "ghc8105"
, node ? "nodejs_latest"
}:
pkgs.haskell-nix.cabalProject {
Expand All @@ -10,12 +10,17 @@ pkgs.haskell-nix.cabalProject {
src = ./.;
};
compiler-nix-name = ghc;
modules = [{
packages.inline-js-core.preBuild =
let nodeSrc = pkgs."${node}";
in
''
substituteInPlace src/Language/JavaScript/Inline/Core/NodePath.hs --replace '"node"' '"${nodeSrc}/bin/node"'
'';
}];
modules = [
{ dontPatchELF = false; }
{ dontStrip = false; }
{
packages.inline-js-core.preConfigure =
let nodeSrc = pkgs."${node}";
in
''
substituteInPlace src/Language/JavaScript/Inline/Core/NodePath.hs --replace '"node"' '"${nodeSrc}/bin/node"'
'';
}
{ packages.inline-js-tests.testFlags = [ "-j$NIX_BUILD_CORES" ]; }
];
}
Loading

0 comments on commit 0fc7444

Please sign in to comment.