From aafb833b059c14161bef3ec1d00280cdb85426d8 Mon Sep 17 00:00:00 2001 From: John Ky Date: Wed, 25 Jan 2023 21:17:57 -0800 Subject: [PATCH 1/4] Remove hlint from nix CI --- .github/workflows/check-hlint.yml | 31 +++++++++++++++++++++++++++++++ flake.nix | 5 +---- 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/check-hlint.yml diff --git a/.github/workflows/check-hlint.yml b/.github/workflows/check-hlint.yml new file mode 100644 index 00000000000..bcb09bd9365 --- /dev/null +++ b/.github/workflows/check-hlint.yml @@ -0,0 +1,31 @@ +name: Check HLint + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + + defaults: + run: + shell: bash + + steps: + + - name: Install Nix + uses: cachix/install-nix-action@v18 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + experimental-features = nix-command flakes + allow-import-from-derivation = true + substituters = https://cache.nixos.org https://hydra.iohk.io + trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + + - uses: actions/checkout@v2 + + - name: Run hlint + run: | + nix build '.#checks/hlint' diff --git a/flake.nix b/flake.nix index 71b7b6967ea..98cea1d1650 100644 --- a/flake.nix +++ b/flake.nix @@ -197,10 +197,7 @@ )) # checks run on default system only; // (optionalAttrs (system == defaultSystem) { - hlint = pkgs.callPackage pkgs.hlintCheck { - inherit (project.args) src; - }; - }); + }); exes = (collectExes project) // { inherit (pkgs) cabalProjectRegenerate checkCabalProject; From 616d8aa0834362b78d818968d6bffd7e0fa44f91 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Tue, 24 Jan 2023 10:06:24 +0100 Subject: [PATCH 2/4] bump cachix/install-nix-action to v18. fix channel/nix to nixos-22.11. fix cache. --- .github/workflows/check-hlint.yml | 7 +++++-- .github/workflows/check-mainnet-config.yml | 7 +++++-- .github/workflows/check-nix-config.yml | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-hlint.yml b/.github/workflows/check-hlint.yml index bcb09bd9365..40f1b43c61e 100644 --- a/.github/workflows/check-hlint.yml +++ b/.github/workflows/check-hlint.yml @@ -16,13 +16,16 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v18 with: + # Use last stable nixos channel and the same nix as in channel: + install_url: https://releases.nixos.org/nix/nix-2.11.1/install + nix_path: nixpkgs=channel:nixos-22.11 github_access_token: ${{ secrets.GITHUB_TOKEN }} extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} experimental-features = nix-command flakes allow-import-from-derivation = true - substituters = https://cache.nixos.org https://hydra.iohk.io - trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://cache.nixos.org https://cache.iog.io + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - uses: actions/checkout@v2 diff --git a/.github/workflows/check-mainnet-config.yml b/.github/workflows/check-mainnet-config.yml index 38925ead4bb..3b7103498eb 100644 --- a/.github/workflows/check-mainnet-config.yml +++ b/.github/workflows/check-mainnet-config.yml @@ -14,15 +14,18 @@ jobs: steps: - name: Install Nix - uses: cachix/install-nix-action@v16 + uses: cachix/install-nix-action@v18 with: + # Use last stable nixos channel and the same nix as in channel: + install_url: https://releases.nixos.org/nix/nix-2.11.1/install + nix_path: nixpkgs=channel:nixos-22.11 github_access_token: ${{ secrets.GITHUB_TOKEN }} extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} experimental-features = nix-command flakes allow-import-from-derivation = true substituters = https://cache.nixos.org https://cache.iog.io - trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - uses: actions/checkout@v2 diff --git a/.github/workflows/check-nix-config.yml b/.github/workflows/check-nix-config.yml index 2e2143ea144..a3a6d5a8536 100644 --- a/.github/workflows/check-nix-config.yml +++ b/.github/workflows/check-nix-config.yml @@ -16,13 +16,16 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v18 with: + # Use last stable nixos channel and the same nix as in channel: + install_url: https://releases.nixos.org/nix/nix-2.11.1/install + nix_path: nixpkgs=channel:nixos-22.11 github_access_token: ${{ secrets.GITHUB_TOKEN }} extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} experimental-features = nix-command flakes allow-import-from-derivation = true - substituters = https://cache.nixos.org https://hydra.iohk.io - trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + substituters = https://cache.nixos.org https://cache.iog.io + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - uses: actions/checkout@v2 From 24c0be98df2d44496d09d1a20cba31a8edd134ea Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Thu, 26 Jan 2023 08:43:27 +0100 Subject: [PATCH 3/4] Move nix hlint checks to nonrequired. now run independently from github workflow. --- flake.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 98cea1d1650..15b4de87029 100644 --- a/flake.nix +++ b/flake.nix @@ -197,7 +197,10 @@ )) # checks run on default system only; // (optionalAttrs (system == defaultSystem) { - }); + hlint = pkgs.callPackage pkgs.hlintCheck { + inherit (project.args) src; + }; + }); exes = (collectExes project) // { inherit (pkgs) cabalProjectRegenerate checkCabalProject; @@ -314,7 +317,11 @@ }; }; }; - defaultNonRequiredPaths = [ "windows.checks.cardano-tracer.cardano-tracer-test" + defaultNonRequiredPaths = [ + # hlint required status is controled via the github action: + "native.checks/hlint" + #FIXME: cardano-tracer-test for windows should probably be disabled in haskell.nix config: + "windows.checks.cardano-tracer.cardano-tracer-test" #FIXME: plutus-scripts-bench (dep of tx-generator) does not compile for windows: "windows.tx-generator" "windows.benchmarks.tx-generator" From 5e22b78cec5bad59b8b6848a890d6d5944bdf69c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Thu, 26 Jan 2023 08:57:59 +0100 Subject: [PATCH 4/4] check-hlint: show build logs --- .github/workflows/check-hlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-hlint.yml b/.github/workflows/check-hlint.yml index 40f1b43c61e..91732b00bd7 100644 --- a/.github/workflows/check-hlint.yml +++ b/.github/workflows/check-hlint.yml @@ -31,4 +31,4 @@ jobs: - name: Run hlint run: | - nix build '.#checks/hlint' + nix build -L '.#checks/hlint'