From f211baab3ee08103a612031826b3800b0c236d90 Mon Sep 17 00:00:00 2001 From: John Ky Date: Fri, 10 Mar 2023 14:08:55 +1100 Subject: [PATCH] Use officially released binary for stylish-haskell --- .github/workflows/stylish-haskell.yml | 82 ++------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) diff --git a/.github/workflows/stylish-haskell.yml b/.github/workflows/stylish-haskell.yml index b0ccf4355db..ce881c41a38 100644 --- a/.github/workflows/stylish-haskell.yml +++ b/.github/workflows/stylish-haskell.yml @@ -47,86 +47,16 @@ jobs: cardano-submit-api steps: - - name: Workaround runner image issue + - name: Download stylish-haskell if: runner.os == 'Linux' - # https://github.com/actions/runner-images/issues/7061 - run: sudo chown -R $USER /usr/local/.ghcup - - - name: Install Haskell - uses: input-output-hk/setup-haskell@v1 - id: setup-haskell - with: - ghc-version: 9.2.7 - cabal-version: 3.8.1.0 - - - name: Cabal update - run: cabal update - - - name: Get stylish-haskell - run: cabal get "stylish-haskell-$STYLISH_HASKELL_VERSION" - - - name: Build dry run for stylish-haskell run: | - cd "stylish-haskell-$STYLISH_HASKELL_VERSION" - cabal build all --dry-run - - # For users who fork cardano-node and want to define a writable cache, then can set up their own - # S3 bucket then define in their forked repository settings the following secrets: - # - # AWS_ACCESS_KEY_ID - # AWS_SECRET_ACCESS_KEY - # BINARY_CACHE_URI - # BINARY_CACHE_REGION - - name: Cabal cache over S3 - uses: action-works/cabal-cache-s3@v1 - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - with: - region: ${{ secrets.BINARY_CACHE_REGION }} - dist-dir: stylish-haskell-${{ env.STYLISH_HASKELL_VERSION }}/dist-newstyle - store-path: ${{ steps.setup-haskell.outputs.cabal-store }} - threads: 16 - archive-uri: ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }} - skip: "${{ secrets.BINARY_CACHE_URI == '' }}" - - # It's important to ensure that people who fork this repository can not only successfully build in - # CI by default, but also have meaning cabal store caching. - # - # Because syncing with S3 requires credentials, we cannot rely on S3 for this. For this reason a - # https fallback is used. The https server mirrors the content of the S3 bucket. The https cabal - # store archive is read-only for security reasons. - # - # Users who fork this repository who want to have a writable cabal store archive are encouraged - # to set up their own S3 bucket. - - name: Cabal cache over HTTPS - uses: action-works/cabal-cache-s3@v1 - with: - dist-dir: stylish-haskell-${{ env.STYLISH_HASKELL_VERSION }}/dist-newstyle - store-path: ${{ steps.setup-haskell.outputs.cabal-store }} - threads: 16 - archive-uri: https://iohk.cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }} - skip: "${{ secrets.BINARY_CACHE_URI != '' }}" - enable-save: false - - - name: Build stylish-haskell - run: | - cd "stylish-haskell-$STYLISH_HASKELL_VERSION" - cabal build all - - - name: Install stylish-haskell - run: | - cd "stylish-haskell-$STYLISH_HASKELL_VERSION" - cabal install exe:stylish-haskell - - - name: Remove stylish-haskell build directory - run: rm -rf "stylish-haskell-$STYLISH_HASKELL_VERSION" + version="${{ env.STYLISH_HASKELL_VERSION }}" - - name: stylish-haskell installation directory - run: find . -name stylish-haskell + curl -sL \ + "https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \ + | tar -C "/tmp" -xz - - name: Add installation directory to path - run: echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV + echo "PATH=/tmp/stylish-haskell-v$version-linux-x86_64:$PATH" >> $GITHUB_ENV - uses: actions/checkout@v2