Skip to content

Commit

Permalink
Host coverage. (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjio authored Sep 13, 2021
1 parent de9cde2 commit 01a7a15
Show file tree
Hide file tree
Showing 6 changed files with 5,693 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<a href="https://miso-haskell.cachix.org">
<img src="https://img.shields.io/badge/build-cachix-yellow.svg?style=flat-square" alt="Cachix">
</a>
<a href="https://travis-ci.org/dmjio/miso">
<img src="https://img.shields.io/travis/dmjio/miso.svg?style=flat-square" alt="Travis CI">
<a href="https://github.com/dmjio/miso/actions">
<img src="https://github.com/dmjio/miso/workflows/test%20matrix/badge.svg" alt="GitHub Actions">
</a>
<a href="http://hackage.haskell.org/package/miso">
<img src="https://img.shields.io/hackage/v/miso.svg?style=flat-square" alt="Hackage">
</a>
<a href="https://www.irccloud.com/invite?channel=%23haskell-miso&amp;hostname=irc.freenode.net&amp;port=6697&amp;ssl=1">
<a href="https://www.irccloud.com/invite?channel=%23haskell-miso&amp;hostname=irc.libera.chat&amp;port=6697&amp;ssl=1">
<img src="https://img.shields.io/badge/irc-%23haskell--miso-1e72ff.svg?style=flat-square" alt="IRC #haskell-miso">
</a>
<a href="https://github.com/dmjio/miso/blob/master/LICENSE">
Expand Down
10 changes: 10 additions & 0 deletions examples/haskell-miso.org/nix/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
nixpkgs.config.packageOverrides = pkgs: {
haskell-miso = import ./../default.nix {};
misoPkgs = import ../../../default.nix { examples = true; };
coverage = import ../../../tests {};
};
services = {
haskell-miso.enable = true;
Expand All @@ -28,6 +29,15 @@
};
};
};
"coverage.haskell-miso.org" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
root = "${pkgs.coverage}/lcov-report";
};
};
};
"flatris.haskell-miso.org" = {
forceSSL = true;
enableACME = true;
Expand Down
2 changes: 1 addition & 1 deletion examples/haskell-miso.org/shared/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ community = template v
]
[ text "Slack" ]
, text " / "
, a_ [ href_ "https://www.irccloud.com/invite?channel=%23haskell-miso&hostname=irc.freenode.net&port=6697&ssl=1"
, a_ [ href_ "https://www.irccloud.com/invite?channel=%23haskell-miso&hostname=irc.libera.chat&port=6697&ssl=1"
, target_ "_blank"
] [ text "#haskell-miso" ]
]
Expand Down
37 changes: 37 additions & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ misoPkgs ? import ../. {} }:

with misoPkgs;

let
yarn2nixSrc = pkgs.fetchFromGitHub {
owner = "mayflower";
repo = "yarn2nix-moretea";
rev = "2ecd70bef182cd1ad5f9ee0d9004b5bd1cbbd023";
sha256 = "0ayrcayly97apl9cw74lxr53f6fgyjc8rzijgc75kvwxhq7fyhxf";
};
yarn2nix = import yarn2nixSrc { inherit pkgs; };
deps =
yarn2nix.mkYarnPackage {
name = "deps";
src = ./.;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
};
in
pkgs.stdenv.mkDerivation rec {
name = "coverage";
src = ./.;
buildCommand = ''
mkdir -p $out
cp ${miso-ghcjs.src}/jsbits/diff.js $out
chmod +w $out/diff.js
cp ${miso-ghcjs.src}/jsbits/isomorphic.js $out
cp ${src}/package.json $out
cp ${src}/diff.test.js $out
cp -r ${deps}/libexec/miso/node_modules $out
echo 'module.exports = diff;' >> $out/diff.js
cd $out
${deps}/libexec/miso/node_modules/jest/./bin/jest.js --collectCoverage=true
cp -rv $out/coverage/lcov-report $out
'';
}
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "miso tests",
"main": "diff.test.js",
"scripts": {
"test": "cp ../jsbits/diff.js ./ && cp ../jsbits/isomorphic.js ./ && echo 'module.exports = diff;' >> diff.js &&./node_modules/.bin/jest --coverage && rm ./diff.js && rm ./isomorphic.js"
"test": "cp ../jsbits/diff.js ./ && cp ../jsbits/isomorphic.js ./ && echo 'module.exports = diff;' >> diff.js &&./node_modules/.bin/jest --collectCoverage=true && rm ./diff.js && rm ./isomorphic.js"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 01a7a15

Please sign in to comment.