From 1df31991ddf4db72c22e711404f342cd0fc12a9c Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Fri, 21 Jun 2024 18:35:46 +0200 Subject: [PATCH 1/4] Add Haskell Language Server check to CI --- .github/workflows/hls.yml | 20 ++++++++++++++++++++ cardano-cli/cardano-cli.cabal | 1 + 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/hls.yml diff --git a/.github/workflows/hls.yml b/.github/workflows/hls.yml new file mode 100644 index 0000000000..d603b77ebc --- /dev/null +++ b/.github/workflows/hls.yml @@ -0,0 +1,20 @@ +name: "Haskell Language Server works" +on: + merge_group: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + test-hls-works: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: cachix/install-nix-action@daddc62a2e67d1decb56e028c9fa68344b9b7c2a + with: + nix_path: nixpkgs=channel:nixos-23.11 + - run: nix develop --accept-flake-config --command bash -c "cabal update; haskell-language-server" diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index b7117bbf97..b1a1fe106f 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -113,6 +113,7 @@ library Cardano.CLI.EraBased.Run.TextView Cardano.CLI.EraBased.Run.Transaction Cardano.CLI.Helpers + Cardano.CLI.IO.Compat Cardano.CLI.IO.Lazy Cardano.CLI.Json.Friendly Cardano.CLI.Legacy.Commands From 78adc8be6f27a237d01ef690075b0679b0904726 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 24 Jun 2024 17:12:22 +0200 Subject: [PATCH 2/4] Apply suggestion by @smelc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Hurlin --- .github/workflows/hls.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hls.yml b/.github/workflows/hls.yml index d603b77ebc..a82ec0e1ff 100644 --- a/.github/workflows/hls.yml +++ b/.github/workflows/hls.yml @@ -13,8 +13,17 @@ jobs: test-hls-works: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - - uses: cachix/install-nix-action@daddc62a2e67d1decb56e028c9fa68344b9b7c2a - with: - nix_path: nixpkgs=channel:nixos-23.11 - - run: nix develop --accept-flake-config --command bash -c "cabal update; haskell-language-server" + - uses: actions/checkout@v4 + - name: Install Nix with good defaults + uses: input-output-hk/install-nix-action@v20 + with: + extra_nix_config: | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-unstable + # Make the Nix environment available to next steps + - uses: rrbutani/use-nix-shell-action@v1 + - run: cabal update; haskell-language-server From e0449a254e4fbc316c8dd2996c12823dc175fe8d Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Tue, 25 Jun 2024 17:22:53 +0200 Subject: [PATCH 3/4] Add caching to HLS check --- .github/workflows/hls.yml | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hls.yml b/.github/workflows/hls.yml index a82ec0e1ff..38b766da33 100644 --- a/.github/workflows/hls.yml +++ b/.github/workflows/hls.yml @@ -10,20 +10,42 @@ permissions: contents: read jobs: + test-hls-works: + env: + # Modify this value to "invalidate" the cache. + HLS_CACHE_VERSION: "2024-06-25" + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check out repo + uses: actions/checkout@v4 - name: Install Nix with good defaults uses: input-output-hk/install-nix-action@v20 with: extra_nix_config: | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= substituters = https://cache.iog.io/ https://cache.nixos.org/ - nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/install-nix-action@v18 + nix_path: nixpkgs=channel:nixos-unstable + - name: Open nix environment + uses: rrbutani/use-nix-shell-action@v1 + - name: Update dependencies + run: cabal update; cabal freeze + - name: Obtain GHC version + run: | + echo "VERSION=$(ghc --numeric-version)" >> "$GITHUB_OUTPUT" + id: ghc + - name: HLS caching + uses: actions/cache@v4 with: - nix_path: nixpkgs=channel:nixos-unstable - # Make the Nix environment available to next steps - - uses: rrbutani/use-nix-shell-action@v1 - - run: cabal update; haskell-language-server + path: | + /home/runner/.cache/hie-bios + /home/runner/.cache/ghcide + /home/runner/.local/state/cabal + .ghc.environment.x86_64-linux-9.8.2 + dist-newstyle + key: hls-cache-${{ env.HLS_CACHE_VERSION }}-${{ runner.os }}-${{ steps.ghc.outputs.VERSION }}-${{ hashFiles('**/cabal.project.freeze') }}-${{ hashFiles('**/*.cabal', '**/cabal.project') }} + restore-keys: | + hls-cache-${{ env.HLS_CACHE_VERSION }}-${{ runner.os }}-${{ steps.ghc.outputs.VERSION }}-${{ hashFiles('**/cabal.project.freeze') }}- + - name: Test HLS works + run: haskell-language-server From 37edd99ab81b0b66d86dced1715ed39f2989277a Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Tue, 25 Jun 2024 22:31:17 +0200 Subject: [PATCH 4/4] Add one hour timeout to HLS check --- .github/workflows/hls.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hls.yml b/.github/workflows/hls.yml index 38b766da33..3a90223d4d 100644 --- a/.github/workflows/hls.yml +++ b/.github/workflows/hls.yml @@ -17,6 +17,7 @@ jobs: HLS_CACHE_VERSION: "2024-06-25" runs-on: ubuntu-latest + timeout-minutes: 60 steps: - name: Check out repo uses: actions/checkout@v4