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 github action #2

Merged
merged 25 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7549705
Create haskell.yml
ali-abrar Jan 29, 2024
d50b8b6
Update haskell.yml
ali-abrar Jan 29, 2024
6352563
Only support ghc-9.2 for now
ali-abrar Jan 30, 2024
b2698be
ci: Fix deprecation warning
ali-abrar Jan 30, 2024
55b6397
Lower base bound
ali-abrar Jan 30, 2024
fb9eec9
Add cabal.project pointing to abacate fork
ali-abrar Jan 30, 2024
1ec293d
ci: use abacate fork
ali-abrar Jan 30, 2024
38031a7
Merge remote-tracking branch 'origin/main' into ali-abrar-patch-1
ali-abrar Jan 30, 2024
0dc296b
Fix cabal.project
ali-abrar Jan 30, 2024
697b7b6
Merge remote-tracking branch 'origin/main' into ali-abrar-patch-1
ali-abrar Jan 30, 2024
60ad580
ci: Add configure step
ali-abrar Jan 30, 2024
8644f7e
ci: do not include ghc9
ali-abrar Jan 31, 2024
5fdf0b6
Revert "ci: do not include ghc9"
ali-abrar Jan 31, 2024
4798f54
Fix cabal.project file
ali-abrar Jan 31, 2024
b0311e4
ci: Simplify github action
ali-abrar Jan 31, 2024
9c7266a
Bump abacate
ali-abrar Jan 31, 2024
895807f
Update abacate nix dep
ali-abrar Jan 31, 2024
8c793ed
cabal: Use allow-newer
ali-abrar Jan 31, 2024
4dd50e6
Merge remote-tracking branch 'origin/main' into ali-abrar-patch-1
ali-abrar Jan 31, 2024
e63996f
ci: remove ghc865
ali-abrar Jan 31, 2024
158ed22
ci: install daml sdk in github action
ali-abrar Feb 1, 2024
304bafc
Merge remote-tracking branch 'origin/main' into ali-abrar-patch-1
ali-abrar Feb 6, 2024
77ae705
ci: limit to ghc-8.10 for now
ali-abrar Feb 6, 2024
be5a767
Use daml on PATH by default, instead of compile-time daml
ali-abrar Feb 6, 2024
d41b78e
ci: No need to install daml sdk anymore
ali-abrar Feb 6, 2024
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
39 changes: 39 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: github-action

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
ghc: ['8.10.7']
os: ['ubuntu-latest', 'macos-latest']
runs-on: ${{ matrix.os }}

name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Cache
uses: actions/cache@v1
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.ghc }}-build-
${{ runner.os }}-${{ matrix.ghc }}-
${{ runner.os }}
- name: Install dependencies
run: |
cabal update
cabal --project-file=ci-cabal.project configure
cabal --project-file=ci-cabal.project build --only-dependencies --enable-tests --enable-benchmarks all
- name: Build
run: cabal --project-file=ci-cabal.project build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal --project-file=ci-cabal.project test all
4 changes: 4 additions & 0 deletions ci-cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
hs/

allow-newer: abacate:*, reflex-process:*, reflex-vty:*
13 changes: 12 additions & 1 deletion hs/daml-cucumber.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ category: Testing
build-type: Simple
extra-doc-files: CHANGELOG.md

flag use-static-which
description: Use System.Which.staticWhich to determine the path
to the daml executable at compile time.
default: False
manual: True

common warnings
ghc-options: -Wall

Expand Down Expand Up @@ -60,12 +66,17 @@ library
, temporary >=1.3 && <1.4
, text >=1.2.4 && <1.3
, unix >=2.7.2 && <2.8
, which >=0.2 && <0.3
, yaml >=0.11 && <0.12

if flag(use-static-which)
build-depends:
which >=0.2 && <0.3
cpp-options: -DSTATIC_WHICH

hs-source-dirs: src
default-language: Haskell2010
default-extensions:
CPP
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
Expand Down
2 changes: 1 addition & 1 deletion hs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
haskellLib = platform.nixpkgs.haskell.lib;
ghc = platform.ghc.override {
overrides = self: super: {
abacate = haskellLib.doJailbreak (haskellLib.markUnbroken super.abacate);
abacate = self.callCabal2nix "abacate" (pkgs.hackGet ./dep/abacate) {};
reflex-process = self.callCabal2nix "reflex-process" (pkgs.hackGet ./dep/reflex-process) {};
which = haskellLib.doJailbreak super.which;
reflex = self.callCabal2nix "reflex" (pkgs.hackGet ./dep/reflex) {};
Expand Down
2 changes: 2 additions & 0 deletions hs/dep/abacate/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import (import ./thunk.nix)
7 changes: 7 additions & 0 deletions hs/dep/abacate/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"owner": "obsidiansystems",
"repo": "abacate",
"private": false,
"rev": "2b94f2b79923a326e1f32b3ad16aabc4b0e79931",
"sha256": "03ncansyi39swdg99pq750m3a9fj9af40cxdrk7a003yi4d0q3rs"
}
12 changes: 12 additions & 0 deletions hs/dep/abacate/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
13 changes: 9 additions & 4 deletions hs/src/Daml/Cucumber/LSP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ import System.Directory
import System.Posix.Process
import System.Posix.Types
import qualified System.Process as Proc
import System.Which
import Text.HTML.TagSoup

#ifdef STATIC_WHICH
import System.Which
damlPath :: FilePath
damlPath = $(staticWhich "daml")
#else
damlPath :: FilePath
damlPath = "daml"
#endif

data RanTest = RanTest
{ ranTestTraces :: [Text]
, ranTestError :: Text
Expand Down Expand Up @@ -235,9 +243,6 @@ instance FromJSON Response where
parseNotification o = do
Notification <$> parseRPC o

damlPath :: FilePath
damlPath = $(staticWhich "daml")

data DamlIde t = DamlIde
{ damlIde_testResponses :: Dynamic t (Set TestResponse)
, damlIde_allResponses :: Dynamic t [Response]
Expand Down
Loading