diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 68943b301..d3f0a942d 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -40,21 +40,25 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-v11-cabal-store - uses: actions/cache@v1 - name: Cache dist-newstyle + id: cache-cabal + name: Cache Cabal artifacts with: - path: dist-newstyle + path: dist-cache key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-semantic-dist - # - name: hlint - # run: | - # test -f dist-newstyle/hlint || cabal install hlint --installdir=dist-newstyle - # dist-newstyle/hlint src semantic-python + - name: Get cabal-cache + run: | + curl -L https://github.com/haskell-works/cabal-cache/releases/download/v1.0.1.8/cabal-cache_x86_64_linux.tar.gz > ./cc.tar.gz + tar -xvf ./cc.tar.gz - - name: Install dependencies + - name: Configure project run: | cabal v2-update cabal v2-configure --project-file=cabal.project.ci --disable-optimization --enable-benchmarks --enable-tests --write-ghc-environment-files=always -j2 - cabal v2-build --project-file=cabal.project.ci all --only-dependencies + + - name: Restore from cache + if: steps.cache-cabal.outputs.cache-hit == 'true' + run: ./cabal-cache sync-from-archive --threads=2 --archive-uri=dist-cache - name: Build & test run: | @@ -73,3 +77,6 @@ jobs: cabal v2-run --project-file=cabal.project.ci semantic-typescript:test cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:test; cd .. cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:doctest -- src; cd .. + + - name: Write out cache + run: ./cabal-cache sync-to-archive --threads=2 --archive-uri=dist-cache