Skip to content

Commit

Permalink
Improve CI:
Browse files Browse the repository at this point in the history
* Use new version of git-modtime

* Fixed caching on MacOS and Windows:
  * Disable caching of stack-work on MacOS, problems running cached binaries.
  * Add caching stack-root on Windows

* Update to newer version of shc
  • Loading branch information
lehins committed Jun 3, 2021
1 parent 77a881e commit 43d27c1
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/haskell.yml
Expand Up @@ -38,22 +38,34 @@ jobs:
env:
STACK_YAML: stack.yaml
STACK_ARGS: '--resolver ${{ matrix.resolver }}'
cache-version: v2 # bump up this version to invalidate currently stored cache
cache-version: v5 # bump up this version to invalidate currently stored cache
steps:
- uses: actions/checkout@v2

- name: Cache
id: cache
uses: actions/cache@v2
if: matrix.os != 'macos-latest'
with:
path: |
~/.stack
.stack-work
Color/.stack-work
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
- name: Cache
id: cache-macos
uses: actions/cache@v2
if: matrix.os == 'macos-latest'
with:
path: |
~/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
- name: Workaround setup-exe-cache failure on macos
if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
if: steps.cache-macos.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
run: |
rm -r ~/.stack/setup-exe-cache
- name: Windows Cache
Expand All @@ -62,7 +74,8 @@ jobs:
if: matrix.os == 'windows-latest'
with:
path: |
~/AppData/Local/Programs/stack
C:\\Users\\RUNNER~1\\AppData\\Roaming\\stack
C:\\Users\\RUNNER~1\\AppData\\Local\\Programs\\stack
key: ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
Expand All @@ -77,7 +90,7 @@ jobs:
run: |
set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl -sSL https://gist.githubusercontent.com/lehins/fd36a8cc8bf853173437b17f6b6426ad/raw/4702d0252731ad8b21317375e917124c590819ce/git-modtime.hs -o git-modtime.hs
curl -sSL https://raw.githubusercontent.com/lehins/utils/786c3fe7e9e1345d7b403019f52e344627224edf/haskell/git-modtime/git-modtime.hs -o git-modtime.hs
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
stack $STACK_ARGS runghc git-modtime.hs
Expand All @@ -91,7 +104,7 @@ jobs:
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then
stack $STACK_ARGS test Color:tests --coverage --haddock --no-haddock-deps
stack $STACK_ARGS hpc report --all
curl -L https://github.com/lehins/stack-hpc-coveralls/releases/download/v0.0.6.0/shc.tar.gz | tar xz shc
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.6.1/shc-linux-x64-8.8.4.tar.bz2 | tar xj shc
./shc --repo-token="$COVERALLS_TOKEN" --partial-coverage --fetch-coverage combined custom
else
stack $STACK_ARGS test Color:tests Color:doctests --bench --no-run-benchmarks --haddock --no-haddock-deps
Expand Down

0 comments on commit 43d27c1

Please sign in to comment.