1
1
mirror of https://github.com/github/semantic.git synced 2024-11-27 12:57:49 +03:00

Try new approach to caching.

This commit is contained in:
Patrick Thomson 2020-05-20 09:06:33 -04:00
parent 25afb3fbb9
commit f7169955bb

View File

@ -40,21 +40,25 @@ jobs:
key: ${{ runner.os }}-${{ matrix.ghc }}-v11-cabal-store key: ${{ runner.os }}-${{ matrix.ghc }}-v11-cabal-store
- uses: actions/cache@v1 - uses: actions/cache@v1
name: Cache dist-newstyle id: cache-cabal
name: Cache Cabal artifacts
with: with:
path: dist-newstyle path: dist-cache
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-semantic-dist key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-v1-semantic-dist
# - name: hlint - name: Get cabal-cache
# run: | run: |
# test -f dist-newstyle/hlint || cabal install hlint --installdir=dist-newstyle 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
# dist-newstyle/hlint src semantic-python tar -xvf ./cc.tar.gz
- name: Install dependencies - name: Configure project
run: | run: |
cabal v2-update 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-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 - name: Build & test
run: | run: |
@ -73,3 +77,6 @@ jobs:
cabal v2-run --project-file=cabal.project.ci semantic-typescript:test 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:test; cd ..
cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:doctest -- src; 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