From e6be9ce8487023b0000bb253e8c07c070a99b447 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 2 Feb 2022 16:59:19 +0000 Subject: [PATCH 01/27] initialised dummy workflow --- .github/workflows/learn-github-actions.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/learn-github-actions.yml diff --git a/.github/workflows/learn-github-actions.yml b/.github/workflows/learn-github-actions.yml new file mode 100644 index 0000000..b09ab79 --- /dev/null +++ b/.github/workflows/learn-github-actions.yml @@ -0,0 +1,13 @@ +name: learn-github-actions +on: [push] +jobs: + check-bats-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - run: npm install -g bats + - run: bats -v + From ed160faa50144c30be9bb5482ebd98c89dc92d31 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 9 Feb 2022 14:52:44 +0000 Subject: [PATCH 02/27] added formatting CI task --- .github/format.sh | 5 ++++ .github/workflows/integrate.yaml | 33 ++++++++++++++++++++++ .github/workflows/learn-github-actions.yml | 13 --------- 3 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 .github/format.sh create mode 100644 .github/workflows/integrate.yaml delete mode 100644 .github/workflows/learn-github-actions.yml diff --git a/.github/format.sh b/.github/format.sh new file mode 100644 index 0000000..3bea3de --- /dev/null +++ b/.github/format.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz \ + -p haskellPackages.fourmolu \ + --run 'make format_check' diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml new file mode 100644 index 0000000..53bead9 --- /dev/null +++ b/.github/workflows/integrate.yaml @@ -0,0 +1,33 @@ +on: + push: + paths: + - "**.hs" + - "**.nix" + - "flake.lock" + - "agora.cabal" + branches: + - master + pull_request: + paths: + - "**.hs" + - "**.nix" + - "flake.lock" + - "agora.cabal" +jobs: + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2.1.4 + name: Cache Stack + with: + path: ~/.stack + key: ${{ runner.os }}-stack-formatting + restore-keys: ${{ runner.os }}-stack- + + - run: stack install fourmolu + name: Setup + + - run: ./.github/format.sh + name: "Run fourmolu" diff --git a/.github/workflows/learn-github-actions.yml b/.github/workflows/learn-github-actions.yml deleted file mode 100644 index b09ab79..0000000 --- a/.github/workflows/learn-github-actions.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: learn-github-actions -on: [push] -jobs: - check-bats-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '14' - - run: npm install -g bats - - run: bats -v - From 25b08b9943ddf7c666ccceab36d8537a93c6c618 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:05:46 +0000 Subject: [PATCH 03/27] formatting --- agora.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agora.cabal b/agora.cabal index bc8e01d..50dfd77 100644 --- a/agora.cabal +++ b/agora.cabal @@ -68,6 +68,7 @@ common deps , data-default-class , plutarch , plutus-core + , plutus-extra , plutus-ledger , plutus-ledger-api , plutus-tx @@ -78,7 +79,6 @@ common deps , serialise , template-haskell , text - , plutus-extra common test-deps build-depends: From 2b74de5aeffe92fec8b81e49a4d6acea0faf4123 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:18:53 +0000 Subject: [PATCH 04/27] made format.sh executable --- .github/format.sh | 0 .github/workflows/integrate.yaml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 .github/format.sh diff --git a/.github/format.sh b/.github/format.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 53bead9..a66c582 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -20,14 +20,14 @@ jobs: - uses: actions/checkout@v2 - uses: actions/cache@v2.1.4 - name: Cache Stack + name: Cache stack with: path: ~/.stack key: ${{ runner.os }}-stack-formatting restore-keys: ${{ runner.os }}-stack- - run: stack install fourmolu - name: Setup + name: "Install fourmolu" - run: ./.github/format.sh name: "Run fourmolu" From 7de53c5db18bb90bb15c9b69540b882268cab9f1 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 9 Feb 2022 16:07:35 +0000 Subject: [PATCH 05/27] Replaced formatwith build command from plutus extra --- .github/workflows/integrate.yaml | 35 ++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index a66c582..be1b86b 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -14,20 +14,29 @@ on: - "flake.lock" - "agora.cabal" jobs: - check-formatting: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - uses: actions/cache@v2.1.4 - name: Cache stack + - uses: cachix/install-nix-action@v13 + name: Set up nix and IOHK cache with: - path: ~/.stack - key: ${{ runner.os }}-stack-formatting - restore-keys: ${{ runner.os }}-stack- - - - run: stack install fourmolu - name: "Install fourmolu" - - - run: ./.github/format.sh - name: "Run fourmolu" + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} + - name: Cache cabal folder + id: cabal + uses: actions/cache@v2.1.4 + with: + path: | + ~/.cabal/packages + ~/.cabal/store + dist-newstyle + key: ${{ runner.os }}-cabal + - name: Build the full ci derivation + run: nix build .#check.x86_64-linux --extra-experimental-features nix-command --extra-experimental-features flakes From e0809a0f89bd380ab0473bd190c2a683dcce4e86 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Wed, 9 Feb 2022 16:08:17 +0000 Subject: [PATCH 06/27] . --- .github/workflows/integrate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index be1b86b..b3c364f 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v13 - name: Set up nix and IOHK cache + name: Set up Nix and IOHK cache with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | From a473ab22c36f004d87079f9d19b78250319532bb Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Thu, 10 Feb 2022 08:41:11 +0000 Subject: [PATCH 07/27] updated flake.lock --- flake.lock | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index f8466b2..38aa550 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ "Shrinker": { "flake": false, "locked": { - "lastModified": 1641477919, - "narHash": "sha256-D6Rl2/2ABrHwBdoU8U4iNU8gVC4MTy14heh4ouCjQE4=", + "lastModified": 1642430208, + "narHash": "sha256-tfWyB7zCLzncwRpyl7eUOzuOBbg9KLu6sxSxRaFlOug=", "owner": "Plutonomicon", "repo": "Shrinker", - "rev": "37bf56e83d0d568232ff2be1ae4daf1946a81189", + "rev": "0e60707996b876c7bd23a348f54545217ce2e556", "type": "github" }, "original": { @@ -696,11 +696,11 @@ "hackage_2": { "flake": false, "locked": { - "lastModified": 1641604316, - "narHash": "sha256-yadiTlqUcS7f5ANmjjunh1xh1vjGdfAlkOwBq/4Slls=", + "lastModified": 1642554756, + "narHash": "sha256-1+SN+z80HgKYshlCf8dRxwRojQzuwwsQ5uq14N/JP1Y=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "f71140013b530aaa38cc3769976c6b2bdb248891", + "rev": "f9d5e67ca90926b244c0ad68815371d37582a149", "type": "github" }, "original": { @@ -712,11 +712,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1643360816, - "narHash": "sha256-M4noTbTGa7oYfg2/8NqDugGX/qs8j//gJUiLwuPU9Co=", + "lastModified": 1642772345, + "narHash": "sha256-fjdNOcd0S35OAvMZu81/im32B7hSIimjs08VKQA58Mw=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "ce41b6459af131c845f942bd39e356f02b6306fa", + "rev": "f0bbc390b995953885506b755f4e4b5c6af618fb", "type": "github" }, "original": { @@ -821,11 +821,11 @@ "stackage": "stackage_2" }, "locked": { - "lastModified": 1641853401, - "narHash": "sha256-62ay0XTxNbNOYt5KnnWXiBTkrUlSY1t0kJR1KeWuGTg=", + "lastModified": 1642811877, + "narHash": "sha256-7YbbFF4ISWMcs5hHDfH7GkCSccvwEwhvKZ5D74Cuajo=", "owner": "L-as", "repo": "haskell.nix", - "rev": "148bd7563804e504ef7bfc53191ba3f84fd91129", + "rev": "ac825b91c202947ec59b1a477003564cc018fcec", "type": "github" }, "original": { @@ -1139,11 +1139,11 @@ }, "nixpkgs-2009": { "locked": { - "lastModified": 1635350005, - "narHash": "sha256-tAMJnUwfaDEB2aa31jGcu7R7bzGELM9noc91L2PbVjg=", + "lastModified": 1624271064, + "narHash": "sha256-qns/uRW7MR2EfVf6VEeLgCsCp7pIOjDeR44JzTF09MA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1c1f5649bb9c1b0d98637c8c365228f57126f361", + "rev": "46d1c3f28ca991601a53e9a14fdd53fcd3dd8416", "type": "github" }, "original": { @@ -1384,6 +1384,7 @@ "hercules-ci-effects": "hercules-ci-effects", "hs-memory": "hs-memory", "nixpkgs": [ + "plutarch", "haskell-nix", "nixpkgs-unstable" ], @@ -1724,11 +1725,11 @@ "stackage_2": { "flake": false, "locked": { - "lastModified": 1641518807, - "narHash": "sha256-aEULsFF9b0vNLUzaj4lnbci8UL6r/6UvuJsY9x04ZJ0=", + "lastModified": 1642468901, + "narHash": "sha256-+Hu4m9i8v8Moey/C8fy8juyxB729JdsXz02cK8nJXLk=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "52fe0717d7e436fdeb6032f1ca342d1d73351716", + "rev": "7544f8fd16bb92b7cf90cb51cb4ddc43173526de", "type": "github" }, "original": { From 5b325611439af7b9ac112d040e60680371b8b032 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Thu, 10 Feb 2022 08:55:50 +0000 Subject: [PATCH 08/27] updated nixpkgs reference --- flake.lock | 2 +- flake.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 38aa550..b014ef0 100644 --- a/flake.lock +++ b/flake.lock @@ -772,7 +772,7 @@ "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", - "nixpkgs-2105" + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2009": "nixpkgs-2009", diff --git a/flake.nix b/flake.nix index 6b9f7a5..0f7d353 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs.haskell-nix.url = "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-2105"; + inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; inputs.plutus.url = "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; From 16d85f48a4c298d7a833b2ccf8b276c5b74c2ee4 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Thu, 10 Feb 2022 09:04:27 +0000 Subject: [PATCH 09/27] reset flake .nix --- flake.lock | 2 +- flake.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index b014ef0..38aa550 100644 --- a/flake.lock +++ b/flake.lock @@ -772,7 +772,7 @@ "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", - "nixpkgs-unstable" + "nixpkgs-2105" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2009": "nixpkgs-2009", diff --git a/flake.nix b/flake.nix index 0f7d353..6b9f7a5 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs.haskell-nix.url = "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; + inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-2105"; inputs.plutus.url = "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; From 703c49bf85474e01bfdf1c37ba57ffabd20f2813 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Thu, 10 Feb 2022 09:07:07 +0000 Subject: [PATCH 10/27] updated flake files --- flake.lock | 2 +- flake.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 38aa550..b014ef0 100644 --- a/flake.lock +++ b/flake.lock @@ -772,7 +772,7 @@ "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", - "nixpkgs-2105" + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2009": "nixpkgs-2009", diff --git a/flake.nix b/flake.nix index 6b9f7a5..0f7d353 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs.haskell-nix.url = "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-2105"; + inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; inputs.plutus.url = "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; From d9b29da4c464fa0945c905a20a7ec314867e0eea Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Fri, 11 Feb 2022 08:23:29 +0000 Subject: [PATCH 11/27] testing workaround --- flake.lock | 311 ++++++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 4 + 2 files changed, 300 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index b014ef0..7b466f5 100644 --- a/flake.lock +++ b/flake.lock @@ -32,6 +32,22 @@ "type": "github" } }, + "HTTP_3": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, "Shrinker": { "flake": false, "locked": { @@ -116,6 +132,23 @@ "type": "github" } }, + "cabal-32_3": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, "cabal-34": { "flake": false, "locked": { @@ -150,6 +183,23 @@ "type": "github" } }, + "cabal-34_3": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, "cabal-36": { "flake": false, "locked": { @@ -383,6 +433,22 @@ "type": "github" } }, + "cardano-shell_3": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, "cardano-wallet": { "flake": false, "locked": { @@ -511,6 +577,21 @@ "type": "github" } }, + "flake-utils_3": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flat": { "flake": false, "locked": { @@ -596,6 +677,23 @@ "type": "github" } }, + "ghc-8.6.5-iohk_3": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, "gitignore-nix": { "flake": false, "locked": { @@ -694,6 +792,22 @@ } }, "hackage_2": { + "flake": false, + "locked": { + "lastModified": 1638407533, + "narHash": "sha256-ja9xIX8eMQz1zFaqHuoeGztxVnUPqIpebfFPXQCtCmU=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "5786405063958e417fdbcf7e75686f35d63708ac", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage_3": { "flake": false, "locked": { "lastModified": 1642554756, @@ -798,27 +912,27 @@ }, "haskell-nix_2": { "inputs": { - "HTTP": "HTTP_2", - "cabal-32": "cabal-32_2", - "cabal-34": "cabal-34_2", + "HTTP": "HTTP_3", + "cabal-32": "cabal-32_3", + "cabal-34": "cabal-34_3", "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell_2", - "flake-utils": "flake-utils_2", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", - "hackage": "hackage_2", - "hpc-coveralls": "hpc-coveralls_2", - "nix-tools": "nix-tools_2", + "cardano-shell": "cardano-shell_3", + "flake-utils": "flake-utils_3", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_3", + "hackage": "hackage_3", + "hpc-coveralls": "hpc-coveralls_3", + "nix-tools": "nix-tools_3", "nixpkgs": [ "plutarch", "haskell-nix", "nixpkgs-2111" ], - "nixpkgs-2003": "nixpkgs-2003_2", - "nixpkgs-2105": "nixpkgs-2105_2", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-unstable": "nixpkgs-unstable_2", - "old-ghc-nix": "old-ghc-nix_2", - "stackage": "stackage_2" + "nixpkgs-2003": "nixpkgs-2003_3", + "nixpkgs-2105": "nixpkgs-2105_3", + "nixpkgs-2111": "nixpkgs-2111_2", + "nixpkgs-unstable": "nixpkgs-unstable_3", + "old-ghc-nix": "old-ghc-nix_3", + "stackage": "stackage_3" }, "locked": { "lastModified": 1642811877, @@ -943,6 +1057,22 @@ "type": "github" } }, + "hpc-coveralls_3": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, "hs-memory": { "flake": false, "locked": { @@ -1059,6 +1189,22 @@ "type": "github" } }, + "nix-tools_3": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, "nixos-20_09": { "locked": { "lastModified": 1623585158, @@ -1137,6 +1283,22 @@ "type": "github" } }, + "nixpkgs-2003_3": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-2009": { "locked": { "lastModified": 1624271064, @@ -1153,6 +1315,22 @@ "type": "github" } }, + "nixpkgs-2009_2": { + "locked": { + "lastModified": 1624271064, + "narHash": "sha256-qns/uRW7MR2EfVf6VEeLgCsCp7pIOjDeR44JzTF09MA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46d1c3f28ca991601a53e9a14fdd53fcd3dd8416", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.09-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-2105": { "locked": { "lastModified": 1630481079, @@ -1170,6 +1348,22 @@ } }, "nixpkgs-2105_2": { + "locked": { + "lastModified": 1630481079, + "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_3": { "locked": { "lastModified": 1640283157, "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", @@ -1186,6 +1380,43 @@ } }, "nixpkgs-2111": { + "inputs": { + "HTTP": "HTTP_2", + "cabal-32": "cabal-32_2", + "cabal-34": "cabal-34_2", + "cardano-shell": "cardano-shell_2", + "flake-utils": "flake-utils_2", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", + "hackage": "hackage_2", + "hpc-coveralls": "hpc-coveralls_2", + "nix-tools": "nix-tools_2", + "nixpkgs": [ + "nixpkgs-2111", + "nixpkgs-2105" + ], + "nixpkgs-2003": "nixpkgs-2003_2", + "nixpkgs-2009": "nixpkgs-2009_2", + "nixpkgs-2105": "nixpkgs-2105_2", + "nixpkgs-unstable": "nixpkgs-unstable_2", + "old-ghc-nix": "old-ghc-nix_2", + "stackage": "stackage_2" + }, + "locked": { + "lastModified": 1641511340, + "narHash": "sha256-cdw4HbqukogROTYG4i9LarwN6+xtRRikO0g35tvAtYk=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + } + }, + "nixpkgs-2111_2": { "locked": { "lastModified": 1640283207, "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", @@ -1234,6 +1465,22 @@ } }, "nixpkgs-unstable_2": { + "locked": { + "lastModified": 1635295995, + "narHash": "sha256-sGYiXjFlxTTMNb4NSkgvX+knOOTipE6gqwPUQpxNF+c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22a500a3f87bbce73bd8d777ef920b43a636f018", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable_3": { "locked": { "lastModified": 1641285291, "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", @@ -1333,6 +1580,23 @@ "type": "github" } }, + "old-ghc-nix_3": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, "optparse-applicative": { "flake": false, "locked": { @@ -1598,6 +1862,7 @@ "haskell-nix", "nixpkgs-unstable" ], + "nixpkgs-2111": "nixpkgs-2111", "optparse-applicative": "optparse-applicative", "ouroboros-network": "ouroboros-network", "plutarch": "plutarch", @@ -1723,6 +1988,22 @@ } }, "stackage_2": { + "flake": false, + "locked": { + "lastModified": 1638062215, + "narHash": "sha256-1kOXkElNdsUOQ0RKVHWpfxh8Tl4I0rwwusESEDkrasI=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "17d51e4b25d266beee4f5038258269b5f87a1551", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_3": { "flake": false, "locked": { "lastModified": 1642468901, diff --git a/flake.nix b/flake.nix index 0f7d353..8e6fb0b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,10 @@ inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; + # Temp workaround for Nix issue. + inputs.nixpkgs-2111.url = + "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; + inputs.plutus.url = "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; From f4ac4f3bb2093cd16246f2fa19e335e160361810 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 08:20:31 +0000 Subject: [PATCH 12/27] tweaked CI workaround --- flake.lock | 308 ++++------------------------------------------------- flake.nix | 3 +- 2 files changed, 23 insertions(+), 288 deletions(-) diff --git a/flake.lock b/flake.lock index 7b466f5..7dc3852 100644 --- a/flake.lock +++ b/flake.lock @@ -32,22 +32,6 @@ "type": "github" } }, - "HTTP_3": { - "flake": false, - "locked": { - "lastModified": 1451647621, - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", - "owner": "phadej", - "repo": "HTTP", - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", - "type": "github" - }, - "original": { - "owner": "phadej", - "repo": "HTTP", - "type": "github" - } - }, "Shrinker": { "flake": false, "locked": { @@ -132,23 +116,6 @@ "type": "github" } }, - "cabal-32_3": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", - "owner": "haskell", - "repo": "cabal", - "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, "cabal-34": { "flake": false, "locked": { @@ -183,23 +150,6 @@ "type": "github" } }, - "cabal-34_3": { - "flake": false, - "locked": { - "lastModified": 1622475795, - "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", - "owner": "haskell", - "repo": "cabal", - "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.4", - "repo": "cabal", - "type": "github" - } - }, "cabal-36": { "flake": false, "locked": { @@ -433,22 +383,6 @@ "type": "github" } }, - "cardano-shell_3": { - "flake": false, - "locked": { - "lastModified": 1608537748, - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", - "owner": "input-output-hk", - "repo": "cardano-shell", - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "cardano-shell", - "type": "github" - } - }, "cardano-wallet": { "flake": false, "locked": { @@ -577,21 +511,6 @@ "type": "github" } }, - "flake-utils_3": { - "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flat": { "flake": false, "locked": { @@ -677,23 +596,6 @@ "type": "github" } }, - "ghc-8.6.5-iohk_3": { - "flake": false, - "locked": { - "lastModified": 1600920045, - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", - "owner": "input-output-hk", - "repo": "ghc", - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "release/8.6.5-iohk", - "repo": "ghc", - "type": "github" - } - }, "gitignore-nix": { "flake": false, "locked": { @@ -792,22 +694,6 @@ } }, "hackage_2": { - "flake": false, - "locked": { - "lastModified": 1638407533, - "narHash": "sha256-ja9xIX8eMQz1zFaqHuoeGztxVnUPqIpebfFPXQCtCmU=", - "owner": "input-output-hk", - "repo": "hackage.nix", - "rev": "5786405063958e417fdbcf7e75686f35d63708ac", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "hackage.nix", - "type": "github" - } - }, - "hackage_3": { "flake": false, "locked": { "lastModified": 1642554756, @@ -912,27 +798,27 @@ }, "haskell-nix_2": { "inputs": { - "HTTP": "HTTP_3", - "cabal-32": "cabal-32_3", - "cabal-34": "cabal-34_3", + "HTTP": "HTTP_2", + "cabal-32": "cabal-32_2", + "cabal-34": "cabal-34_2", "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell_3", - "flake-utils": "flake-utils_3", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_3", - "hackage": "hackage_3", - "hpc-coveralls": "hpc-coveralls_3", - "nix-tools": "nix-tools_3", + "cardano-shell": "cardano-shell_2", + "flake-utils": "flake-utils_2", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", + "hackage": "hackage_2", + "hpc-coveralls": "hpc-coveralls_2", + "nix-tools": "nix-tools_2", "nixpkgs": [ "plutarch", "haskell-nix", "nixpkgs-2111" ], - "nixpkgs-2003": "nixpkgs-2003_3", - "nixpkgs-2105": "nixpkgs-2105_3", + "nixpkgs-2003": "nixpkgs-2003_2", + "nixpkgs-2105": "nixpkgs-2105_2", "nixpkgs-2111": "nixpkgs-2111_2", - "nixpkgs-unstable": "nixpkgs-unstable_3", - "old-ghc-nix": "old-ghc-nix_3", - "stackage": "stackage_3" + "nixpkgs-unstable": "nixpkgs-unstable_2", + "old-ghc-nix": "old-ghc-nix_2", + "stackage": "stackage_2" }, "locked": { "lastModified": 1642811877, @@ -1057,22 +943,6 @@ "type": "github" } }, - "hpc-coveralls_3": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "type": "github" - } - }, "hs-memory": { "flake": false, "locked": { @@ -1189,22 +1059,6 @@ "type": "github" } }, - "nix-tools_3": { - "flake": false, - "locked": { - "lastModified": 1636018067, - "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", - "owner": "input-output-hk", - "repo": "nix-tools", - "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "nix-tools", - "type": "github" - } - }, "nixos-20_09": { "locked": { "lastModified": 1623585158, @@ -1283,22 +1137,6 @@ "type": "github" } }, - "nixpkgs-2003_3": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2009": { "locked": { "lastModified": 1624271064, @@ -1315,22 +1153,6 @@ "type": "github" } }, - "nixpkgs-2009_2": { - "locked": { - "lastModified": 1624271064, - "narHash": "sha256-qns/uRW7MR2EfVf6VEeLgCsCp7pIOjDeR44JzTF09MA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "46d1c3f28ca991601a53e9a14fdd53fcd3dd8416", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.09-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-2105": { "locked": { "lastModified": 1630481079, @@ -1348,22 +1170,6 @@ } }, "nixpkgs-2105_2": { - "locked": { - "lastModified": 1630481079, - "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105_3": { "locked": { "lastModified": 1640283157, "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", @@ -1380,39 +1186,18 @@ } }, "nixpkgs-2111": { - "inputs": { - "HTTP": "HTTP_2", - "cabal-32": "cabal-32_2", - "cabal-34": "cabal-34_2", - "cardano-shell": "cardano-shell_2", - "flake-utils": "flake-utils_2", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", - "hackage": "hackage_2", - "hpc-coveralls": "hpc-coveralls_2", - "nix-tools": "nix-tools_2", - "nixpkgs": [ - "nixpkgs-2111", - "nixpkgs-2105" - ], - "nixpkgs-2003": "nixpkgs-2003_2", - "nixpkgs-2009": "nixpkgs-2009_2", - "nixpkgs-2105": "nixpkgs-2105_2", - "nixpkgs-unstable": "nixpkgs-unstable_2", - "old-ghc-nix": "old-ghc-nix_2", - "stackage": "stackage_2" - }, "locked": { - "lastModified": 1641511340, - "narHash": "sha256-cdw4HbqukogROTYG4i9LarwN6+xtRRikO0g35tvAtYk=", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "lastModified": 1644510859, + "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", "type": "github" }, "original": { - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", "type": "github" } }, @@ -1465,22 +1250,6 @@ } }, "nixpkgs-unstable_2": { - "locked": { - "lastModified": 1635295995, - "narHash": "sha256-sGYiXjFlxTTMNb4NSkgvX+knOOTipE6gqwPUQpxNF+c=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "22a500a3f87bbce73bd8d777ef920b43a636f018", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable_3": { "locked": { "lastModified": 1641285291, "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", @@ -1580,23 +1349,6 @@ "type": "github" } }, - "old-ghc-nix_3": { - "flake": false, - "locked": { - "lastModified": 1631092763, - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", - "owner": "angerman", - "repo": "old-ghc-nix", - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", - "type": "github" - }, - "original": { - "owner": "angerman", - "ref": "master", - "repo": "old-ghc-nix", - "type": "github" - } - }, "optparse-applicative": { "flake": false, "locked": { @@ -1988,22 +1740,6 @@ } }, "stackage_2": { - "flake": false, - "locked": { - "lastModified": 1638062215, - "narHash": "sha256-1kOXkElNdsUOQ0RKVHWpfxh8Tl4I0rwwusESEDkrasI=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "17d51e4b25d266beee4f5038258269b5f87a1551", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", - "type": "github" - } - }, - "stackage_3": { "flake": false, "locked": { "lastModified": 1642468901, diff --git a/flake.nix b/flake.nix index 8e6fb0b..e4751d7 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,7 @@ inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; # Temp workaround for Nix issue. - inputs.nixpkgs-2111.url = - "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; + inputs.nixpkgs-2111.url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; inputs.plutus.url = "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; From 0750a9ba08c4b326866bb49368846629992eb32b Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:49:22 +0000 Subject: [PATCH 13/27] Integrate lint and format --- .github/workflows/integrate.yaml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b3c364f..70ee951 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -7,6 +7,7 @@ on: - "agora.cabal" branches: - master + - staging pull_request: paths: - "**.hs" @@ -14,6 +15,42 @@ on: - "flake.lock" - "agora.cabal" jobs: + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2.1.4 + name: Cache Stack + with: + path: ~/.stack + key: ${{ runner.os }}-stack-formatting + restore-keys: ${{ runner.os }}-stack- + + - run: stack install fourmolu + name: Setup + + - run: ./.github/format.sh + name: "Run fourmolu" + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2.1.4 + name: Cache Stack + with: + path: ~/.stack + key: ${{ runner.os }}-stack-lint + restore-keys: ${{ runner.os }}-stack- + + - run: stack install hlint + name: Setup + + - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + name: Lint + build: runs-on: ubuntu-latest steps: From 57ef1faa63b1d8a3437ffd990a045bc3d3d73ecc Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 11:06:42 +0000 Subject: [PATCH 14/27] Updated fourmolu script --- .github/format.sh | 7 ++++--- .gitignore | 1 + src/Agora/AuthorityToken.hs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/format.sh b/.github/format.sh index 3bea3de..2373ce1 100755 --- a/.github/format.sh +++ b/.github/format.sh @@ -1,5 +1,6 @@ #!/bin/bash -nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz \ - -p haskellPackages.fourmolu \ - --run 'make format_check' +# Extensions necessary to tell fourmolu about +EXTENSIONS="-o -XTypeApplications -o -XTemplateHaskell -o -XImportQualifiedPost -o -XPatternSynonyms -o -fplugin=RecordDotPreprocessor" +SOURCES=$(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') +~/.local/bin/fourmolu --mode check --check-idempotence $EXTENSIONS $SOURCES diff --git a/.gitignore b/.gitignore index 9699888..5ae1889 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ result-* .vscode/ .idea tags +TAGS .nvimrc *.tix diff --git a/src/Agora/AuthorityToken.hs b/src/Agora/AuthorityToken.hs index bbd2849..4b59f8d 100644 --- a/src/Agora/AuthorityToken.hs +++ b/src/Agora/AuthorityToken.hs @@ -24,7 +24,7 @@ import Plutarch.Prelude said transaction. Said validator should be made aware of _this_ token's existence in order to prevent incorrect minting. -} -data AuthorityToken = AuthorityToken +newtype AuthorityToken = AuthorityToken { -- | Token that must move in order for minting this to be valid. authority :: AssetClass } From e55168fce8ad364cccb8e39cb127ffcff4bdf863 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 11:47:24 +0000 Subject: [PATCH 15/27] gave steps more descriptive names --- .github/workflows/integrate.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 70ee951..cd38c93 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -21,42 +21,42 @@ jobs: - uses: actions/checkout@v2 - uses: actions/cache@v2.1.4 - name: Cache Stack + name: Add Stack files to cache. with: path: ~/.stack key: ${{ runner.os }}-stack-formatting restore-keys: ${{ runner.os }}-stack- - run: stack install fourmolu - name: Setup + name: Install fourmolu. - run: ./.github/format.sh - name: "Run fourmolu" + name: Run fourmolu. - lint: + run-linter: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/cache@v2.1.4 - name: Cache Stack + name: Add Stack files to Cache. with: path: ~/.stack key: ${{ runner.os }}-stack-lint restore-keys: ${{ runner.os }}-stack- - run: stack install hlint - name: Setup + name: Install hlint - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - name: Lint + name: Run hlint. - build: + check-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v13 - name: Set up Nix and IOHK cache + name: Set up Nix and IOHK caches. with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | @@ -66,7 +66,7 @@ jobs: with: name: mlabs authToken: ${{ secrets.CACHIX_KEY }} - - name: Cache cabal folder + - name: Add cabal folder to cache. id: cabal uses: actions/cache@v2.1.4 with: @@ -75,5 +75,5 @@ jobs: ~/.cabal/store dist-newstyle key: ${{ runner.os }}-cabal - - name: Build the full ci derivation + - name: Build the project. run: nix build .#check.x86_64-linux --extra-experimental-features nix-command --extra-experimental-features flakes From 4cc3a5f7924dc0f88a2d1cb9d2c0d932091d609d Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:11:34 +0000 Subject: [PATCH 16/27] Added failing test --- agora.cabal | 1 + hie.yaml | 2 ++ test/Spec.hs | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/agora.cabal b/agora.cabal index 50dfd77..2f3a649 100644 --- a/agora.cabal +++ b/agora.cabal @@ -86,6 +86,7 @@ common test-deps , quickcheck-instances , tagged , tasty + , tasty-hunit , utf8-string -------------------------------------------------------------------------------- diff --git a/hie.yaml b/hie.yaml index 2a1e864..23b82b5 100644 --- a/hie.yaml +++ b/hie.yaml @@ -2,3 +2,5 @@ cradle: cabal: - path: "./src" component: "lib:agora" + - path: "./test" + component: "test:agora-test" diff --git a/test/Spec.hs b/test/Spec.hs index 8534df0..3aecc52 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -5,8 +5,14 @@ import Prelude -------------------------------------------------------------------------------- import Test.Tasty (defaultMain, testGroup) +import Test.Tasty.HUnit (assertBool, testCase) -------------------------------------------------------------------------------- main :: IO () -main = defaultMain $ testGroup "Suites" [] +main = + defaultMain $ + testGroup + "Suites" + [ testCase "will fail" $ assertBool "false" False + ] From 5f0f53ba79e16b74c62c771c0239a3bd9d90b2de Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:12:46 +0000 Subject: [PATCH 17/27] Removed full stops for consistency --- .github/workflows/integrate.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index cd38c93..b4551ca 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -21,17 +21,17 @@ jobs: - uses: actions/checkout@v2 - uses: actions/cache@v2.1.4 - name: Add Stack files to cache. + name: Add Stack files to cache with: path: ~/.stack key: ${{ runner.os }}-stack-formatting restore-keys: ${{ runner.os }}-stack- - run: stack install fourmolu - name: Install fourmolu. + name: Install fourmolu - run: ./.github/format.sh - name: Run fourmolu. + name: Run fourmolu run-linter: runs-on: ubuntu-latest @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/cache@v2.1.4 - name: Add Stack files to Cache. + name: Add Stack files to cache with: path: ~/.stack key: ${{ runner.os }}-stack-lint @@ -49,14 +49,14 @@ jobs: name: Install hlint - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - name: Run hlint. + name: Run hlint check-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v13 - name: Set up Nix and IOHK caches. + name: Set up Nix and IOHK caches with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | @@ -66,7 +66,7 @@ jobs: with: name: mlabs authToken: ${{ secrets.CACHIX_KEY }} - - name: Add cabal folder to cache. + - name: Add cabal folder to cache id: cabal uses: actions/cache@v2.1.4 with: @@ -75,5 +75,5 @@ jobs: ~/.cabal/store dist-newstyle key: ${{ runner.os }}-cabal - - name: Build the project. + - name: Build the project run: nix build .#check.x86_64-linux --extra-experimental-features nix-command --extra-experimental-features flakes From 75187895bc7ad8c779a50890a7d4d4db94d5d8b6 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:43:35 +0000 Subject: [PATCH 18/27] Examine behaviour of hlint and fourmolu without Stack --- .github/workflows/integrate.yaml | 47 +++++++++++++++++--------------- test/Spec.hs | 7 +---- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b4551ca..7f6906a 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -18,17 +18,17 @@ jobs: check-formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.4.0 - - uses: actions/cache@v2.1.4 - name: Add Stack files to cache - with: - path: ~/.stack - key: ${{ runner.os }}-stack-formatting - restore-keys: ${{ runner.os }}-stack- + # - uses: actions/cache@v2.1.4 + # name: Add Stack files to cache + # with: + # path: ~/.stack + # key: ${{ runner.os }}-stack-formatting + # restore-keys: ${{ runner.os }}-stack- - - run: stack install fourmolu - name: Install fourmolu + # - run: stack install fourmolu + # name: Install fourmolu - run: ./.github/format.sh name: Run fourmolu @@ -36,32 +36,34 @@ jobs: run-linter: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.4.0 - - uses: actions/cache@v2.1.4 - name: Add Stack files to cache - with: - path: ~/.stack - key: ${{ runner.os }}-stack-lint - restore-keys: ${{ runner.os }}-stack- + # - uses: actions/cache@v2.1.4 + # name: Add Stack files to cache + # with: + # path: ~/.stack + # key: ${{ runner.os }}-stack-lint + # restore-keys: ${{ runner.os }}-stack- - - run: stack install hlint - name: Install hlint + # - run: stack install hlint + # name: Install hlint - - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint check-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v13 + - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 name: Set up Nix and IOHK caches with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes - uses: cachix/cachix-action@v10 with: name: mlabs @@ -76,4 +78,5 @@ jobs: dist-newstyle key: ${{ runner.os }}-cabal - name: Build the project - run: nix build .#check.x86_64-linux --extra-experimental-features nix-command --extra-experimental-features flakes + run: nix build + run: nix flake check diff --git a/test/Spec.hs b/test/Spec.hs index 3aecc52..9cfc14c 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -5,14 +5,9 @@ import Prelude -------------------------------------------------------------------------------- import Test.Tasty (defaultMain, testGroup) -import Test.Tasty.HUnit (assertBool, testCase) -------------------------------------------------------------------------------- main :: IO () main = - defaultMain $ - testGroup - "Suites" - [ testCase "will fail" $ assertBool "false" False - ] + defaultMain $ testGroup "Suites" [] From 8dffed824b8a6a135df8204f405e3b09f5c70d42 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:45:01 +0000 Subject: [PATCH 19/27] fix yaml syntax error --- .github/workflows/integrate.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 7f6906a..482d5e1 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -78,5 +78,5 @@ jobs: dist-newstyle key: ${{ runner.os }}-cabal - name: Build the project - run: nix build - run: nix flake check + run: nix build + - run: nix flake check From 2e895f4490b11829f1ec80fb652ca983b8e08785 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:55:09 +0000 Subject: [PATCH 20/27] removed flake check --- .github/workflows/integrate.yaml | 68 ++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 482d5e1..4db4f81 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -15,42 +15,42 @@ on: - "flake.lock" - "agora.cabal" jobs: - check-formatting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 + # check-formatting: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2.4.0 - # - uses: actions/cache@v2.1.4 - # name: Add Stack files to cache - # with: - # path: ~/.stack - # key: ${{ runner.os }}-stack-formatting - # restore-keys: ${{ runner.os }}-stack- + # - uses: actions/cache@v2.1.4 + # name: Add Stack files to cache + # with: + # path: ~/.stack + # key: ${{ runner.os }}-stack-formatting + # restore-keys: ${{ runner.os }}-stack- - # - run: stack install fourmolu - # name: Install fourmolu + # - run: stack install fourmolu + # name: Install fourmolu - - run: ./.github/format.sh - name: Run fourmolu + # - run: ./.github/format.sh + # name: Run fourmolu - run-linter: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 + # run-linter: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2.4.0 - # - uses: actions/cache@v2.1.4 - # name: Add Stack files to cache - # with: - # path: ~/.stack - # key: ${{ runner.os }}-stack-lint - # restore-keys: ${{ runner.os }}-stack- + # # - uses: actions/cache@v2.1.4 + # # name: Add Stack files to cache + # # with: + # # path: ~/.stack + # # key: ${{ runner.os }}-stack-lint + # # restore-keys: ${{ runner.os }}-stack- - # - run: stack install hlint - # name: Install hlint + # # - run: stack install hlint + # # name: Install hlint - # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - name: Run hlint + # # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + # - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + # name: Run hlint check-build: runs-on: ubuntu-latest @@ -79,4 +79,12 @@ jobs: key: ${{ runner.os }}-cabal - name: Build the project run: nix build - - run: nix flake check + + - name: Enter Nix environment + run: nix develop + + - run: ./.github/format.sh + name: Run fourmolu + + - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + name: Run hlint From 144bc963c38e7fab4fa0d4ba7b332f8425babace Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:18:49 +0000 Subject: [PATCH 21/27] Implement nix run --- .github/format.sh | 2 +- .github/workflows/integrate.yaml | 54 +++++++------------------------- 2 files changed, 13 insertions(+), 43 deletions(-) diff --git a/.github/format.sh b/.github/format.sh index 2373ce1..90be9ca 100755 --- a/.github/format.sh +++ b/.github/format.sh @@ -3,4 +3,4 @@ # Extensions necessary to tell fourmolu about EXTENSIONS="-o -XTypeApplications -o -XTemplateHaskell -o -XImportQualifiedPost -o -XPatternSynonyms -o -fplugin=RecordDotPreprocessor" SOURCES=$(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') -~/.local/bin/fourmolu --mode check --check-idempotence $EXTENSIONS $SOURCES +nix run nixpkgs#haskellPackages.fourmolu -- --mode check --check-idempotence $EXTENSIONS $SOURCES diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 4db4f81..1a11bf8 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -15,42 +15,21 @@ on: - "flake.lock" - "agora.cabal" jobs: - # check-formatting: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2.4.0 + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 - # - uses: actions/cache@v2.1.4 - # name: Add Stack files to cache - # with: - # path: ~/.stack - # key: ${{ runner.os }}-stack-formatting - # restore-keys: ${{ runner.os }}-stack- + - run: ./.github/format.sh + name: Run fourmolu - # - run: stack install fourmolu - # name: Install fourmolu + run-linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 - # - run: ./.github/format.sh - # name: Run fourmolu - - # run-linter: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2.4.0 - - # # - uses: actions/cache@v2.1.4 - # # name: Add Stack files to cache - # # with: - # # path: ~/.stack - # # key: ${{ runner.os }}-stack-lint - # # restore-keys: ${{ runner.os }}-stack- - - # # - run: stack install hlint - # # name: Install hlint - - # # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - # - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - # name: Run hlint + - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') + name: Run hlint check-build: runs-on: ubuntu-latest @@ -79,12 +58,3 @@ jobs: key: ${{ runner.os }}-cabal - name: Build the project run: nix build - - - name: Enter Nix environment - run: nix develop - - - run: ./.github/format.sh - name: Run fourmolu - - - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') - name: Run hlint From 1e4b4c26530db2988fc472ad75c302a87efefe77 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:21:11 +0000 Subject: [PATCH 22/27] Fixed workflow by adding nix install commands --- .github/workflows/integrate.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 1a11bf8..f2476c9 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -19,6 +19,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} - run: ./.github/format.sh name: Run fourmolu @@ -27,6 +39,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint From 2c487e81cb03ed6f854e3fa9eef286aebf618afd Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:03:57 +0000 Subject: [PATCH 23/27] Separated nix logic --- .github/workflows/integrate.yaml | 40 +++---------------------------- .github/workflows/prepare-nix.yml | 23 ++++++++++++++++++ 2 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/prepare-nix.yml diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index f2476c9..6f32452 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -17,56 +17,22 @@ on: jobs: check-formatting: runs-on: ubuntu-latest + uses: ./prepare-nix.yml steps: - - uses: actions/checkout@v2.4.0 - - uses: cachix/install-nix-action@v16 - name: Set up Nix and IOHK caches - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v10 - with: - name: mlabs - authToken: ${{ secrets.CACHIX_KEY }} - - run: ./.github/format.sh name: Run fourmolu run-linter: runs-on: ubuntu-latest + uses: ./prepare-nix.yml steps: - - uses: actions/checkout@v2.4.0 - - uses: cachix/install-nix-action@v16 - name: Set up Nix and IOHK caches - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ - experimental-features = nix-command flakes - - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint check-build: runs-on: ubuntu-latest + uses: ./prepare-nix.yml steps: - - uses: actions/checkout@v2.4.0 - - uses: cachix/install-nix-action@v16 - name: Set up Nix and IOHK caches - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v10 - with: - name: mlabs - authToken: ${{ secrets.CACHIX_KEY }} - name: Add cabal folder to cache id: cabal uses: actions/cache@v2.1.4 diff --git a/.github/workflows/prepare-nix.yml b/.github/workflows/prepare-nix.yml new file mode 100644 index 0000000..8921f28 --- /dev/null +++ b/.github/workflows/prepare-nix.yml @@ -0,0 +1,23 @@ +on: + workflow_call: + secrets: + CACHIX_KEY: + required: true + +jobs: + prepare_nix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} From 552bfa3517c24b2899880e0828e9ac7284e411b4 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:11:03 +0000 Subject: [PATCH 24/27] attempting fix --- .github/workflows/integrate.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 6f32452..6198ba2 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -17,21 +17,27 @@ on: jobs: check-formatting: runs-on: ubuntu-latest - uses: ./prepare-nix.yml + uses: ./.github/workflows/prepare-nix.yml + secrets: + CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - run: ./.github/format.sh name: Run fourmolu run-linter: runs-on: ubuntu-latest - uses: ./prepare-nix.yml + uses: ./.github/workflows/prepare-nix.yml + secrets: + CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint check-build: runs-on: ubuntu-latest - uses: ./prepare-nix.yml + uses: ./.github/workflows/prepare-nix.yml + secrets: + CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - name: Add cabal folder to cache id: cabal From ef23dd649d510a47f1aa24bf594d3bc9cfb34d4d Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:14:24 +0000 Subject: [PATCH 25/27] restructured workflows --- .github/workflows/integrate.yaml | 28 ++++++++++++++++++++-------- .github/workflows/prepare-nix.yml | 23 ----------------------- 2 files changed, 20 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/prepare-nix.yml diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 6198ba2..b067747 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -15,9 +15,25 @@ on: - "flake.lock" - "agora.cabal" jobs: - check-formatting: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} + check-formatting: + needs: setup runs-on: ubuntu-latest - uses: ./.github/workflows/prepare-nix.yml secrets: CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: @@ -25,19 +41,15 @@ jobs: name: Run fourmolu run-linter: + needs: setup runs-on: ubuntu-latest - uses: ./.github/workflows/prepare-nix.yml - secrets: - CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint check-build: + needs: setup runs-on: ubuntu-latest - uses: ./.github/workflows/prepare-nix.yml - secrets: - CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - name: Add cabal folder to cache id: cabal diff --git a/.github/workflows/prepare-nix.yml b/.github/workflows/prepare-nix.yml deleted file mode 100644 index 8921f28..0000000 --- a/.github/workflows/prepare-nix.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - workflow_call: - secrets: - CACHIX_KEY: - required: true - -jobs: - prepare_nix: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 - - uses: cachix/install-nix-action@v16 - name: Set up Nix and IOHK caches - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v10 - with: - name: mlabs - authToken: ${{ secrets.CACHIX_KEY }} From aeb20b7c1af360a852930c69e485198262f4ecd9 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:15:02 +0000 Subject: [PATCH 26/27] fix syntax error --- .github/workflows/integrate.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b067747..3ec5af4 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -34,8 +34,6 @@ jobs: check-formatting: needs: setup runs-on: ubuntu-latest - secrets: - CACHIX_KEY: ${{ secrets.CACHIX_KEY }} steps: - run: ./.github/format.sh name: Run fourmolu From 3702f321a9bdd82430d0937d19f71bc351018442 Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 16:20:55 +0000 Subject: [PATCH 27/27] Given up on trying to find efficiencies --- .github/workflows/integrate.yaml | 44 +++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 3ec5af4..10b425d 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -15,10 +15,11 @@ on: - "flake.lock" - "agora.cabal" jobs: - setup: + check-formatting: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v16 name: Set up Nix and IOHK caches with: @@ -27,28 +28,56 @@ jobs: trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 with: name: mlabs authToken: ${{ secrets.CACHIX_KEY }} - check-formatting: - needs: setup - runs-on: ubuntu-latest - steps: + - run: ./.github/format.sh name: Run fourmolu run-linter: - needs: setup runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2.4.0 + + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes + + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} + - run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs') name: Run hlint check-build: - needs: setup runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2.4.0 + + - uses: cachix/install-nix-action@v16 + name: Set up Nix and IOHK caches + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ + experimental-features = nix-command flakes + + - uses: cachix/cachix-action@v10 + with: + name: mlabs + authToken: ${{ secrets.CACHIX_KEY }} + - name: Add cabal folder to cache id: cabal uses: actions/cache@v2.1.4 @@ -58,5 +87,6 @@ jobs: ~/.cabal/store dist-newstyle key: ${{ runner.os }}-cabal + - name: Build the project run: nix build