mirror of
https://github.com/stackbuilders/hapistrano.git
synced 2024-11-25 21:06:51 +03:00
Fix build cache issues (#192)
This commit is contained in:
parent
c377835763
commit
00f285010b
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@ -2,6 +2,7 @@
|
||||
# - https://github.com/actions/cache/blob/main/examples.md#haskell---cabal
|
||||
# - https://github.com/haskell/time/blob/master/.github/workflows/ci.yml
|
||||
# - https://github.com/stackbuilders/stache/blob/master/.github/workflows/ci.yaml
|
||||
# - https://markkarpov.com/post/github-actions-for-haskell-ci.html
|
||||
---
|
||||
name: CI
|
||||
|
||||
@ -25,34 +26,28 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: haskell/actions/setup@v1
|
||||
- if: ${{ runner.os == 'Linux' }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install zsh
|
||||
- if: ${{ runner.os == 'macOS' }}
|
||||
run: |
|
||||
brew update
|
||||
brew install zsh
|
||||
- uses: haskell/actions/setup@v2
|
||||
with:
|
||||
ghc-version: ${{ matrix.ghc }}
|
||||
cabal-version: "3.6"
|
||||
- run: |
|
||||
if [ "$RUNNER_OS" == "Linux" ]
|
||||
then
|
||||
sudo apt-get update
|
||||
sudo apt-get install zsh
|
||||
else
|
||||
brew update
|
||||
brew install zsh
|
||||
fi
|
||||
- run: cabal update
|
||||
id: setup-haskell
|
||||
- run: cabal configure --enable-tests
|
||||
- run: cabal freeze
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('*.cabal', 'cabal.project.freeze') }}
|
||||
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
|
||||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
||||
path: |
|
||||
~/.cabal/packages
|
||||
~/.cabal/store
|
||||
${{ steps.setup-haskell.outputs.cabal-store }}
|
||||
dist-newstyle
|
||||
- run: cabal build --only-dependencies
|
||||
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
|
||||
- run: cabal build
|
||||
- run: cabal test
|
||||
- run: |
|
||||
# Fixes issue with different haddock coverage with different ghc versions https://github.com/haskell/haddock/issues/123
|
||||
cabal haddock | grep "100%" | wc -l | grep -E "[4-9]|[1-9][0-9]+" ||
|
||||
(echo "Haddock failed with exit code 1. Have you checked that the minimum of 4 modules with 100% documentation is fulfilled?" && false)
|
||||
- run: ./script/haddock
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ cabal-dev
|
||||
*.dyn_o
|
||||
*.dyn_hi
|
||||
.cabal-sandbox/
|
||||
.envrc
|
||||
.hpc
|
||||
.hsenv
|
||||
.tool-versions
|
||||
|
13
script/haddock
Executable file
13
script/haddock
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
min_count=4
|
||||
count=$(cabal haddock | grep "100%" | wc -l)
|
||||
|
||||
if [ "$count" -le "$min_count" ];
|
||||
then
|
||||
echo "Haddock failed with exit code 1. Have you checked that the minimum of ${min_count} modules with 100% documentation is fulfilled?"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user