From 9e69b129f431372facb3baeade3e8b7e5674c2ea Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 28 Jun 2021 23:27:17 +0200 Subject: [PATCH 01/26] First version hackage ci --- .github/workflows/hackage.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/hackage.yml diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml new file mode 100644 index 0000000000..9895a57691 --- /dev/null +++ b/.github/workflows/hackage.yml @@ -0,0 +1,41 @@ +name: Hackage + +defaults: + run: + shell: bash + +on: + push: + branches: + - '*-hackage' + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + package: ["hls-plugin-api", "ghcide", "hls-test-utils", + "hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin", + "hls-ourmolu-plugin", "hls-stylish-haskell-plugin", + "hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin", + "hls-haddock-comments-plugin", "hls-hlint-plugin", + "hls-module-name-plugin", "hls-pragmas-plugin", + "hls-refine-imports-plugin", "hls-retrie-plugin", + "hls-splice-plugin", "hls-tactics-plugin"] + + steps: + - name: "Run cabal check" + run: | + if [[ name == *plugin ]]; then + cd plugins + fi + cd ${{ package }} + cabal check + + - name: "Generate haddock for hackage" + run: cabal haddock --haddock-for-hackage ${{ package }} + + - name: "Build with hackage head" + run: cabal build --index-state=HEAD ${{ package }} + + From 6b5940cec5ea348a14ed2823e1cc595c34599f96 Mon Sep 17 00:00:00 2001 From: jneira Date: Thu, 29 Jul 2021 23:37:48 +0200 Subject: [PATCH 02/26] Add hls-call-hierarchy-plugin --- .github/workflows/hackage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 9895a57691..b079f3faaf 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -21,7 +21,8 @@ jobs: "hls-haddock-comments-plugin", "hls-hlint-plugin", "hls-module-name-plugin", "hls-pragmas-plugin", "hls-refine-imports-plugin", "hls-retrie-plugin", - "hls-splice-plugin", "hls-tactics-plugin"] + "hls-splice-plugin", "hls-tactics-plugin", + "hls-call-hierarchy-plugin"] steps: - name: "Run cabal check" From ce5fe59d3deb4afe8132eb20d390b359e60706d6 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 22:17:27 +0200 Subject: [PATCH 03/26] Unnecessary default shell --- .github/workflows/hackage.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index b079f3faaf..ba5170e0cd 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -1,9 +1,5 @@ name: Hackage -defaults: - run: - shell: bash - on: push: branches: From 2937f92215de3a8deced95d88bc45d51fe93ba06 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 22:26:13 +0200 Subject: [PATCH 04/26] Correct variable --- .github/workflows/hackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index ba5170e0cd..8a4917c01c 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -23,7 +23,7 @@ jobs: steps: - name: "Run cabal check" run: | - if [[ name == *plugin ]]; then + if [[ ${{ package }} == *plugin ]]; then cd plugins fi cd ${{ package }} From f6ea6bf42e320e5436ac24121da826fc55feeece Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 22:32:23 +0200 Subject: [PATCH 05/26] Add checkout and haskell setup --- .github/workflows/hackage.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 8a4917c01c..fa5031bbd8 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -19,20 +19,31 @@ jobs: "hls-refine-imports-plugin", "hls-retrie-plugin", "hls-splice-plugin", "hls-tactics-plugin", "hls-call-hierarchy-plugin"] + ghc: ["9.0.1", "8.10.7", "8.8.4", "8.6.5"] steps: + + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: '3.4' + - name: "Run cabal check" run: | - if [[ ${{ package }} == *plugin ]]; then + if [[ ${{ matrix.package }} == *plugin ]]; then cd plugins fi cd ${{ package }} cabal check - name: "Generate haddock for hackage" - run: cabal haddock --haddock-for-hackage ${{ package }} + run: cabal haddock --haddock-for-hackage ${{ matrix.package }} - name: "Build with hackage head" - run: cabal build --index-state=HEAD ${{ package }} + run: cabal build --index-state=HEAD ${{ matrix.package }} From 90737262823f6fec5a34d27b65f0391ee2ba3bf5 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 22:34:38 +0200 Subject: [PATCH 06/26] Correct variable --- .github/workflows/hackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index fa5031bbd8..96edca5ba6 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -37,7 +37,7 @@ jobs: if [[ ${{ matrix.package }} == *plugin ]]; then cd plugins fi - cd ${{ package }} + cd ${{ matrix.package }} cabal check - name: "Generate haddock for hackage" From 32f214cc8f01ce6304417d9c4c6331909568d749 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 23:03:41 +0200 Subject: [PATCH 07/26] Add cabal cache --- .github/workflows/hackage.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 96edca5ba6..2c1ff3dc1a 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -32,6 +32,20 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: '3.4' + - name: Cache Cabal + uses: actions/cache@v2 + env: + cache-name: cache-cabal + with: + path: | + ${{ env.CABAL_PKGS_DIR }} + ${{ env.CABAL_STORE_DIR }} + key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} + restore-keys: | + v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} + v2-${{ runner.os }}-${{ matrix.ghc }}-build- + v2-${{ runner.os }}-${{ matrix.ghc }} + - name: "Run cabal check" run: | if [[ ${{ matrix.package }} == *plugin ]]; then From 227ef73049eacbfa3ad6af15601ade942de789f1 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 23:04:01 +0200 Subject: [PATCH 08/26] Set description in all packages --- .../hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal | 3 +++ .../hls-explicit-imports-plugin.cabal | 2 ++ plugins/hls-hlint-plugin/hls-hlint-plugin.cabal | 2 +- plugins/hls-retrie-plugin/hls-retrie-plugin.cabal | 2 ++ plugins/hls-splice-plugin/hls-splice-plugin.cabal | 2 +- .../hls-stylish-haskell-plugin.cabal | 2 ++ plugins/hls-tactics-plugin/hls-tactics-plugin.cabal | 3 ++- 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal index 140f547c95..6cb7d4e112 100644 --- a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal +++ b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal @@ -2,6 +2,9 @@ cabal-version: 2.4 name: hls-call-hierarchy-plugin version: 1.0.0.2 synopsis: Call hierarchy plugin for Haskell Language Server +description: + Please see the README on GitHub at + license: Apache-2.0 license-file: LICENSE author: Lei Zhu diff --git a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal index 98961ad2f5..cde982cf6f 100644 --- a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal +++ b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.2 name: hls-explicit-imports-plugin version: 1.0.0.4 synopsis: Explicit imports plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: Pepe Iborra diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal index 3a0c54485c..9a839d33ae 100644 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal @@ -3,7 +3,7 @@ name: hls-hlint-plugin version: 1.0.1.1 synopsis: Hlint integration plugin with Haskell Language Server description: - Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme) + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE diff --git a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal index 74ddd52caf..7b9f1c190e 100644 --- a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal +++ b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.2 name: hls-retrie-plugin version: 1.0.1.1 synopsis: Retrie integration plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: Pepe Iborra diff --git a/plugins/hls-splice-plugin/hls-splice-plugin.cabal b/plugins/hls-splice-plugin/hls-splice-plugin.cabal index 64786bfd33..4f9d7600e5 100644 --- a/plugins/hls-splice-plugin/hls-splice-plugin.cabal +++ b/plugins/hls-splice-plugin/hls-splice-plugin.cabal @@ -5,7 +5,7 @@ synopsis: HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes description: - HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes. + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE diff --git a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal index 25570a2156..42ced2748b 100644 --- a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal +++ b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.4 name: hls-stylish-haskell-plugin version: 1.0.0.2 synopsis: Integration with the Stylish Haskell code formatter +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: The Haskell IDE Team diff --git a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal index 161f7e2613..ef9e605202 100644 --- a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal +++ b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal @@ -3,7 +3,8 @@ category: Development name: hls-tactics-plugin version: 1.3.0.0 synopsis: Wingman plugin for Haskell Language Server -description: Please see README.md +description: + Please see the README on GitHub at author: Sandy Maguire, Reed Mullanix maintainer: sandy@sandymaguire.me copyright: Sandy Maguire, Reed Mullanix From a5494b9cfe4df30ddcc4a999e48e369060c7a043 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 23:11:04 +0200 Subject: [PATCH 09/26] Fix cache --- .github/workflows/hackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 2c1ff3dc1a..b09d95ded7 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -38,8 +38,8 @@ jobs: cache-name: cache-cabal with: path: | - ${{ env.CABAL_PKGS_DIR }} - ${{ env.CABAL_STORE_DIR }} + ~/.cabal/packages + ~/.cabal/store key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} restore-keys: | v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} From a0c995d4da062c7b6154b4715b3eac3cfb9e97d8 Mon Sep 17 00:00:00 2001 From: jneira Date: Sat, 4 Sep 2021 23:20:23 +0200 Subject: [PATCH 10/26] Fix build ghc-9.0.1 --- .github/workflows/hackage.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index b09d95ded7..04710eb016 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -32,6 +32,11 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: '3.4' + # Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file + - if: ${{ matrix.ghc == '9.0.1' }} + name: Use modified cabal.project for ghc9 + run: cp cabal-ghc901.project cabal.project + - name: Cache Cabal uses: actions/cache@v2 env: @@ -54,10 +59,9 @@ jobs: cd ${{ matrix.package }} cabal check - - name: "Generate haddock for hackage" - run: cabal haddock --haddock-for-hackage ${{ matrix.package }} - - name: "Build with hackage head" run: cabal build --index-state=HEAD ${{ matrix.package }} + - name: "Generate haddock for hackage" + run: cabal haddock --index-state=HEAD --haddock-for-hackage ${{ matrix.package }} From 79d5165b74b08babb5c166994f757c921d5cdd24 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 06:21:19 +0200 Subject: [PATCH 11/26] Cabal sdist and unpack --- .github/workflows/hackage.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 04710eb016..7af43d4f93 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -6,7 +6,7 @@ on: - '*-hackage' jobs: - release: + check: runs-on: ubuntu-latest strategy: matrix: @@ -19,7 +19,7 @@ jobs: "hls-refine-imports-plugin", "hls-retrie-plugin", "hls-splice-plugin", "hls-tactics-plugin", "hls-call-hierarchy-plugin"] - ghc: ["9.0.1", "8.10.7", "8.8.4", "8.6.5"] + ghc: [""8.10.7", "8.8.4", "8.6.5"] steps: @@ -59,6 +59,12 @@ jobs: cd ${{ matrix.package }} cabal check + - name: "Generate dist tarball" + run: cabal sdist ${{ matrix.package }} --builddir: . + + - name: "Unpack the source in an isolated location" + run: cabal unpack ./sdist/${{ matrix.package }} --destdir=./packages + - name: "Build with hackage head" run: cabal build --index-state=HEAD ${{ matrix.package }} From 10866bcda3d3ccfda6dacde1f12bd25e7c65e778 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 11:31:31 +0200 Subject: [PATCH 12/26] Add all local packages --- .github/workflows/hackage.yml | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 7af43d4f93..682db314da 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - package: ["hls-plugin-api", "ghcide", "hls-test-utils", + package: ["hie-compat", "hls-graph", "shake-bench", + "hls-plugin-api", "ghcide", "hls-test-utils", "hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin", "hls-ourmolu-plugin", "hls-stylish-haskell-plugin", "hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin", @@ -18,8 +19,9 @@ jobs: "hls-module-name-plugin", "hls-pragmas-plugin", "hls-refine-imports-plugin", "hls-retrie-plugin", "hls-splice-plugin", "hls-tactics-plugin", - "hls-call-hierarchy-plugin"] - ghc: [""8.10.7", "8.8.4", "8.6.5"] + "hls-call-hierarchy-plugin", + "haskell-language-server"] + ghc: ["8.10.7", "8.8.4", "8.6.5"] steps: @@ -32,11 +34,6 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: '3.4' - # Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file - - if: ${{ matrix.ghc == '9.0.1' }} - name: Use modified cabal.project for ghc9 - run: cp cabal-ghc901.project cabal.project - - name: Cache Cabal uses: actions/cache@v2 env: @@ -45,9 +42,9 @@ jobs: path: | ~/.cabal/packages ~/.cabal/store - key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} + key: v2-${{ runner.os }}-${{ matrix.ghc }}-hackage-${{ hashFiles('**/*.cabal') }} restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} + v2-${{ runner.os }}-${{ matrix.ghc }}-hackage- v2-${{ runner.os }}-${{ matrix.ghc }}-build- v2-${{ runner.os }}-${{ matrix.ghc }} @@ -56,18 +53,34 @@ jobs: if [[ ${{ matrix.package }} == *plugin ]]; then cd plugins fi - cd ${{ matrix.package }} + if [[ ${{ matrix.package }} != haskell-language-server ]]; + cd ${{ matrix.package }} + fi cabal check - name: "Generate dist tarball" - run: cabal sdist ${{ matrix.package }} --builddir: . + run: | + if [[ ${{ matrix.package }} == haskell-language-server ]]; then + cabal sdist --builddir=./ + else + cabal sdist ${{ matrix.package }} --builddir=./ + fi - name: "Unpack the source in an isolated location" - run: cabal unpack ./sdist/${{ matrix.package }} --destdir=./packages + run: cabal unpack $(ls ./sdist/${{ matrix.package }}-*) --destdir=./packages - - name: "Build with hackage head" - run: cabal build --index-state=HEAD ${{ matrix.package }} + - name: "Create appropiate cabal.project" + run: | + cd $(ls -d ./packages/${{ matrix.package }}-*) + echo "packages: . ../../* ../../plugins/*" > cabal.project + + - name: "Build all in isolation" + run: | + cd $(ls -d ./packages/${{ matrix.package }}-*) + cabal build --enable-tests --enable-benchmarks - name: "Generate haddock for hackage" - run: cabal haddock --index-state=HEAD --haddock-for-hackage ${{ matrix.package }} + run: | + cd $(ls -d ./packages/${{ matrix.package }}-*) + cabal haddock --haddock-for-hackage From 634de838dff56ece1bf1987d1fbde639e4d81b65 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 11:34:14 +0200 Subject: [PATCH 13/26] Correct bash if --- .github/workflows/hackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 682db314da..5efb921536 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -53,7 +53,7 @@ jobs: if [[ ${{ matrix.package }} == *plugin ]]; then cd plugins fi - if [[ ${{ matrix.package }} != haskell-language-server ]]; + if [[ ${{ matrix.package }} != haskell-language-server ]]; then cd ${{ matrix.package }} fi cabal check From e39d9100b2e21831f88f2567138266264f68e97c Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 11:40:36 +0200 Subject: [PATCH 14/26] Add allow-newer for shake-bench --- .github/workflows/hackage.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 5efb921536..fa094b36e9 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -73,8 +73,10 @@ jobs: run: | cd $(ls -d ./packages/${{ matrix.package }}-*) echo "packages: . ../../* ../../plugins/*" > cabal.project + # TODO: remove when not needed + echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project - - name: "Build all in isolation" + - name: "Build all package components in isolation" run: | cd $(ls -d ./packages/${{ matrix.package }}-*) cabal build --enable-tests --enable-benchmarks From 98fd390df4881e13acdc60d1b63216e8b86e5721 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 11:56:53 +0200 Subject: [PATCH 15/26] Use ghc-8.10.6 --- .github/workflows/hackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index fa094b36e9..3f8d71c06e 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -21,7 +21,7 @@ jobs: "hls-splice-plugin", "hls-tactics-plugin", "hls-call-hierarchy-plugin", "haskell-language-server"] - ghc: ["8.10.7", "8.8.4", "8.6.5"] + ghc: ["8.10.6", "8.8.4", "8.6.5"] steps: From 82b96bfcfc42558018801217d189c5c69c4ac048 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 12:13:45 +0200 Subject: [PATCH 16/26] Upload tarball artifacts --- .github/workflows/hackage.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 3f8d71c06e..ece8c04dca 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -58,16 +58,18 @@ jobs: fi cabal check - - name: "Generate dist tarball" + - name: "Generate package dist tarball" + id: generate-dist-tarball run: | if [[ ${{ matrix.package }} == haskell-language-server ]]; then cabal sdist --builddir=./ else cabal sdist ${{ matrix.package }} --builddir=./ fi + echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*) - - name: "Unpack the source in an isolated location" - run: cabal unpack $(ls ./sdist/${{ matrix.package }}-*) --destdir=./packages + - name: "Unpack package source in an isolated location" + run: cabal unpack ${{ generate-dist-tarball.outputs.path }} --destdir=./packages - name: "Create appropiate cabal.project" run: | @@ -86,3 +88,9 @@ jobs: cd $(ls -d ./packages/${{ matrix.package }}-*) cabal haddock --haddock-for-hackage + - name: "Upload package dist tarball" + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.package }} + path: ${{ generate-dist-tarball.outputs.path }} + From 3ed1e5be63813bf77f3925524d1f0d0227353268 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 12:15:17 +0200 Subject: [PATCH 17/26] Correct output key --- .github/workflows/hackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index ece8c04dca..b813f09bb7 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -69,7 +69,7 @@ jobs: echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*) - name: "Unpack package source in an isolated location" - run: cabal unpack ${{ generate-dist-tarball.outputs.path }} --destdir=./packages + run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./packages - name: "Create appropiate cabal.project" run: | @@ -92,5 +92,5 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ matrix.package }} - path: ${{ generate-dist-tarball.outputs.path }} + path: ${{ steps.generate-dist-tarball.outputs.path }} From cd0df38cdb5c3592e7d2343ad80f41724474339f Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 13:43:12 +0200 Subject: [PATCH 18/26] Check the current hackage version --- .github/workflows/hackage.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index b813f09bb7..20a96c9c7a 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -71,7 +71,22 @@ jobs: - name: "Unpack package source in an isolated location" run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./packages + - name: "Try to get the current hackage version" + id: get-hackage-version + run: | + cd ./packages + cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current + echo ::set-output name=exists::$? + + - name: "Compare the incoming and the current hackage version of the package" + id: compare-current-version + if: steps.get-hackage-version.exists == 0 + run: | + # This will throw an error if there is any difference casue we have to bump up the package version + diff -qr -x "*.md" -x "data" $(ls -d ./packages/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) + - name: "Create appropiate cabal.project" + if: steps.get-hackage-version.exists == 1 run: | cd $(ls -d ./packages/${{ matrix.package }}-*) echo "packages: . ../../* ../../plugins/*" > cabal.project @@ -79,16 +94,19 @@ jobs: echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project - name: "Build all package components in isolation" + if: steps.get-hackage-version.exists == 1 run: | cd $(ls -d ./packages/${{ matrix.package }}-*) cabal build --enable-tests --enable-benchmarks - name: "Generate haddock for hackage" + if: steps.get-hackage-version.exists == 1 run: | cd $(ls -d ./packages/${{ matrix.package }}-*) cabal haddock --haddock-for-hackage - name: "Upload package dist tarball" + if: steps.get-hackage-version.exists == 1 uses: actions/upload-artifact@v2 with: name: ${{ matrix.package }} From 0ea596490af96342c7b5f1b3425b29143dcaaec1 Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 14:03:52 +0200 Subject: [PATCH 19/26] Ignore cabal get error --- .github/workflows/hackage.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 20a96c9c7a..73a944dc9b 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -75,18 +75,19 @@ jobs: id: get-hackage-version run: | cd ./packages - cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current - echo ::set-output name=exists::$? + if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then + echo ::set-output name=exists::true + fi - name: "Compare the incoming and the current hackage version of the package" id: compare-current-version - if: steps.get-hackage-version.exists == 0 + if: steps.get-hackage-version.exists == 'true' run: | # This will throw an error if there is any difference casue we have to bump up the package version diff -qr -x "*.md" -x "data" $(ls -d ./packages/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) - name: "Create appropiate cabal.project" - if: steps.get-hackage-version.exists == 1 + if: steps.get-hackage-version.exists != 'true' run: | cd $(ls -d ./packages/${{ matrix.package }}-*) echo "packages: . ../../* ../../plugins/*" > cabal.project @@ -94,19 +95,19 @@ jobs: echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project - name: "Build all package components in isolation" - if: steps.get-hackage-version.exists == 1 + if: steps.get-hackage-version.exists != 'true' run: | cd $(ls -d ./packages/${{ matrix.package }}-*) cabal build --enable-tests --enable-benchmarks - name: "Generate haddock for hackage" - if: steps.get-hackage-version.exists == 1 + if: steps.get-hackage-version.exists != 'true' run: | cd $(ls -d ./packages/${{ matrix.package }}-*) cabal haddock --haddock-for-hackage - name: "Upload package dist tarball" - if: steps.get-hackage-version.exists == 1 + if: steps.get-hackage-version.exists != 'true' uses: actions/upload-artifact@v2 with: name: ${{ matrix.package }} From aaa66811b06e6990bcd69c9c866c7bbc1b1cba3f Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 14:32:41 +0200 Subject: [PATCH 20/26] Add upload tarballs job --- .github/workflows/hackage.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 73a944dc9b..501e60997d 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -6,7 +6,7 @@ on: - '*-hackage' jobs: - check: + check-and-upload-tarballs: runs-on: ubuntu-latest strategy: matrix: @@ -69,12 +69,12 @@ jobs: echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*) - name: "Unpack package source in an isolated location" - run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./packages + run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming - name: "Try to get the current hackage version" id: get-hackage-version run: | - cd ./packages + cd ./incoming if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then echo ::set-output name=exists::true fi @@ -84,12 +84,12 @@ jobs: if: steps.get-hackage-version.exists == 'true' run: | # This will throw an error if there is any difference casue we have to bump up the package version - diff -qr -x "*.md" -x "data" $(ls -d ./packages/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) + diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) - name: "Create appropiate cabal.project" if: steps.get-hackage-version.exists != 'true' run: | - cd $(ls -d ./packages/${{ matrix.package }}-*) + cd $(ls -d ./incoming/${{ matrix.package }}-*) echo "packages: . ../../* ../../plugins/*" > cabal.project # TODO: remove when not needed echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project @@ -97,13 +97,13 @@ jobs: - name: "Build all package components in isolation" if: steps.get-hackage-version.exists != 'true' run: | - cd $(ls -d ./packages/${{ matrix.package }}-*) + cd $(ls -d ./incoming/${{ matrix.package }}-*) cabal build --enable-tests --enable-benchmarks - name: "Generate haddock for hackage" if: steps.get-hackage-version.exists != 'true' run: | - cd $(ls -d ./packages/${{ matrix.package }}-*) + cd $(ls -d ./incoming/${{ matrix.package }}-*) cabal haddock --haddock-for-hackage - name: "Upload package dist tarball" @@ -113,3 +113,15 @@ jobs: name: ${{ matrix.package }} path: ${{ steps.generate-dist-tarball.outputs.path }} + upload-candidate: + needs: check-and-upload-tarballs + runs-on: ubuntu-latest + steps: + + - uses: actions/download-artifact@v2 + + - name: "Upload all tarballs to hackage" + uses: haskell-actions/hackage-publish@v1 + with: + hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }} + publish: false From 2afeec7f4800e36a653abc0f24d822503b9dd7ec Mon Sep 17 00:00:00 2001 From: jneira Date: Mon, 6 Sep 2021 23:53:12 +0200 Subject: [PATCH 21/26] Add lower bound for aeson --- .../hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal index 6cb7d4e112..5d6ac8b9b8 100644 --- a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal +++ b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal @@ -24,7 +24,7 @@ library hs-source-dirs: src build-depends: - , aeson + , aeson >=1.5.2.0 , base >=4.12 && <5 , bytestring , containers From 77f532915b55ff361c0b5c7f39a499a82584f4dd Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Tue, 7 Sep 2021 08:13:08 +0200 Subject: [PATCH 22/26] Correct ormolu plugin id --- .github/workflows/hackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 501e60997d..022baed527 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -13,7 +13,7 @@ jobs: package: ["hie-compat", "hls-graph", "shake-bench", "hls-plugin-api", "ghcide", "hls-test-utils", "hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin", - "hls-ourmolu-plugin", "hls-stylish-haskell-plugin", + "hls-ormolu-plugin", "hls-stylish-haskell-plugin", "hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin", "hls-haddock-comments-plugin", "hls-hlint-plugin", "hls-module-name-plugin", "hls-pragmas-plugin", From b445cfae1177a9fb1ee9ca8488cc8a19d3ea7612 Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 7 Sep 2021 08:49:20 +0200 Subject: [PATCH 23/26] Reuse the test/bench cache --- .github/workflows/hackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 022baed527..64a4c25e3c 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -42,9 +42,9 @@ jobs: path: | ~/.cabal/packages ~/.cabal/store - key: v2-${{ runner.os }}-${{ matrix.ghc }}-hackage-${{ hashFiles('**/*.cabal') }} + key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-hackage- + v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} v2-${{ runner.os }}-${{ matrix.ghc }}-build- v2-${{ runner.os }}-${{ matrix.ghc }} From 8796afb3e6f1be7dd018f69f96737d061324a55f Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 7 Sep 2021 09:43:25 +0200 Subject: [PATCH 24/26] Fix cabal check warnings --- .../hls-refine-imports-plugin/hls-refine-imports-plugin.cabal | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal index 7b16113a4a..4a2b3a71b9 100644 --- a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal +++ b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal @@ -1,7 +1,9 @@ -cabal-version: 2.2 +cabal-version: 2.4 name: hls-refine-imports-plugin version: 1.0.0.1 synopsis: Refine imports plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: rayshih From 8bbc7a4263be11bd680fc470d8c43f35bc2ec323 Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 7 Sep 2021 11:49:49 +0200 Subject: [PATCH 25/26] Fix tarball location --- .github/workflows/hackage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 64a4c25e3c..4cf09e7184 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -119,9 +119,15 @@ jobs: steps: - uses: actions/download-artifact@v2 + with: + path: packages + + - name: "Join all tarballs" + run: find ./packages -type f -name '*.tar.gz' -exec cp {} ./packages \; - name: "Upload all tarballs to hackage" uses: haskell-actions/hackage-publish@v1 with: hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }} + packagesPath: packages publish: false From 1fd80c4c80fc89aa59166df1c683468f7df48fea Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 7 Sep 2021 12:21:10 +0200 Subject: [PATCH 26/26] Build with ghc-8.10.7 --- .github/workflows/hackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 4cf09e7184..ec0d308098 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -21,7 +21,7 @@ jobs: "hls-splice-plugin", "hls-tactics-plugin", "hls-call-hierarchy-plugin", "haskell-language-server"] - ghc: ["8.10.6", "8.8.4", "8.6.5"] + ghc: ["8.10.7", "8.8.4", "8.6.5"] steps: @@ -83,7 +83,7 @@ jobs: id: compare-current-version if: steps.get-hackage-version.exists == 'true' run: | - # This will throw an error if there is any difference casue we have to bump up the package version + # This will throw an error if there is any difference cause we have to bump up the package version diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) - name: "Create appropiate cabal.project"