Update README.md #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Haskell CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: [ "8.10.7", "9.2.7", "9.6.1" ] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dos2unix (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install dos2unix | |
- name: Install dos2unix (MacOS) | |
if: matrix.os == 'macos-latest' | |
run: brew install dos2unix | |
- name: Select build directory | |
run: echo "CABAL_BUILDDIR=dist" >> $GITHUB_ENV | |
- uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: 3.10.1.0 | |
- name: Cabal update | |
run: cabal update | |
- name: Cabal Configure | |
run: cabal build --dry-run --enable-tests --enable-benchmarks --write-ghc-environment-files=always | |
- name: Record dependencies | |
run: | | |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt | |
- name: Set cache version | |
run: echo "CACHE_VERSION=9w76Z3Q" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: Cache cabal store | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
restore-keys: | | |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}- | |
- name: Install dependencies | |
run: cabal build all --only-dependencies | |
- name: Build | |
run: cabal build all | |
- name: Adjust golden files | |
run: find tests/goldens -type f | xargs dos2unix | |
- name: Run tests | |
run: cabal test all |