From 727f24ccf6e3b367b4ff05777c64b7c9ca4debdb Mon Sep 17 00:00:00 2001 From: cydparser Date: Sun, 5 Jun 2022 23:48:14 -0700 Subject: Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise --- .github/workflows/ci.yml | 24 ++++++++++++------------ .github/workflows/hlint-ci.yml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c147cbdc..5e2e8b34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ jobs: os: [ubuntu-latest] cabal: ["3.6"] ghc: - - "9.2.1" + - "9.2.2" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: haskell/actions/setup@v1 + - uses: haskell/actions/setup@v2 id: setup-haskell-cabal name: Setup Haskell with: @@ -32,29 +32,29 @@ jobs: # not include documentation, and we need documentation to run Haddock tests. # Therefore, we reinstall GHC to ensure that we have the documentation we # need. - - # TODO: Only reinstall GHC when the docs are actually missing. (If we're - # using a GHC version that is not preinstalled by GitHub, then we will be - # using a GHC installed by ghcup, which should have documentation.) - name: Reinstall GHC with docs run: | - ghcup rm ghc ${{ matrix.ghc }} - ghcup install ghc ${{ matrix.ghc }} + if [[ ! -e ~/.ghcup/ghc/${{ matrix.ghc }}/share/doc ]]; then + ghcup install ghc --force ${{ matrix.ghc }} --set + fi - - name: Freeze + - name: Setup run: | + cabal configure --with-compiler ghc-${{ matrix.ghc }} --enable-tests --enable-benchmarks --test-show-details=direct cabal freeze - + - uses: actions/cache@v2 name: Cache ~/.cabal/store with: path: | ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + dist-newstyle key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + restore-keys: | + ${{ runner.os }}-cabal-${{ matrix.ghc }} - name: Build run: | - cabal configure --enable-tests --enable-benchmarks --test-show-details=direct cabal build all - name: Test diff --git a/.github/workflows/hlint-ci.yml b/.github/workflows/hlint-ci.yml index b6bdc029..692d03e8 100644 --- a/.github/workflows/hlint-ci.yml +++ b/.github/workflows/hlint-ci.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true -- cgit v1.2.3