Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiwi committed Nov 20, 2020
1 parent d430d09 commit ed2433d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,25 @@
name: "Test"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-20.03
extra_nix_config: |
substituters = https://cache.nixos.org https://cache.nixos.org/ https://hydra.iohk.io https://cachix.cachix.org https://iohk.cachix.org https://ghcide-nix.cachix.org https://mostlyabsurd.cachix.org https://absurd-paste-client.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cachix.cachix.org:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM= all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k= cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= ghcide-nix.cachix.org-1:ibAY5FD+XWLzbLr8fxK6n8fL9zZe7jS+gYeyxyWYK5c= mostlyabsurd.cachix.org-1:WoFsXSqFZNZj9+1TcbfiEdAmP5T20oQoU7jIi4RlcVU=
- uses: cachix/cachix-action@v8
with:
name: absurd-paste-client
# If you chose signing key for write access
#signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: iohk
- run: nix-build
- run: nix-shell --run "echo OK"
6 changes: 4 additions & 2 deletions .gitignore
@@ -1,7 +1,9 @@
.ghc.environment.x86_64-linux-8.6.5
cabal.project.local
cabal.project.local~
dist-newstyle/
dist/
dist-newstyle
dist
*.swp
.*.swp
result
.gitignore
1 change: 1 addition & 0 deletions absurd-paste-client.cabal
Expand Up @@ -80,6 +80,7 @@ executable apc
-- Other library packages from which modules are imported.
build-depends: base ^>=4.13.0.0
, bytestring
, dhall
, http-streams
, io-streams
, optparse-applicative
Expand Down
20 changes: 13 additions & 7 deletions default.nix
Expand Up @@ -14,12 +14,18 @@ haskellNix ? import (builtins.fetchTarball

# import nixpkgs with overlays
, pkgs ? import nixpkgsSrc nixpkgsArgs }:
pkgs.haskell-nix.project {
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "absurd-paste-client";
src = ./.;
let
apc-project = pkgs.haskell-nix.project {
index-state = "2020-11-20T00:00:00Z";
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "absurd-paste-client";
src = ./.;
};
# For `cabal.project` based projects specify the GHC version to use.
compiler-nix-name = "ghc884"; # Not used for `stack.yaml` based projects.
};
# For `cabal.project` based projects specify the GHC version to use.
compiler-nix-name = "ghc884"; # Not used for `stack.yaml` based projects.
in {
project = apc-project.absurd-paste-client.components.exes.apc;
apc-project = apc-project;
}
6 changes: 3 additions & 3 deletions shell.nix
Expand Up @@ -2,7 +2,7 @@
"https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") { }
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
, nixpkgsArgs ? haskellNix.nixpkgsArgs, pkgs ? import nixpkgsSrc nixpkgsArgs }:
let hsPkgs = import ./default.nix { inherit pkgs; };
let hsPkgs = (import ./default.nix { inherit pkgs; }).apc-project;
in hsPkgs.shellFor {
# Include only the *local* packages of your project.
packages = ps: with ps; [ absurd-paste-client ];
Expand All @@ -16,8 +16,8 @@ in hsPkgs.shellFor {
# Some common tools can be added with the `tools` argument
tools = {
cabal = "3.2.0.0";
hlint = "3.1.6";
ghcide = "0.2.0";
hlint = "3.2.1";
haskell-language-server = "0.5.1";
};
# See overlays/tools.nix for more details

Expand Down

0 comments on commit ed2433d

Please sign in to comment.