Merge pull request #15 from rickowens/pr #5
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
on: [push] | |
name: Haskell Builds | |
jobs: | |
build: | |
name: Haskell Build | |
runs-on: ubuntu-latest # or macOS-latest, or windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc-version: | |
- '9.4' | |
- '9.6' | |
- '9.8' | |
- '9.10' | |
cabal-version: ['3.12.1.0'] | |
steps: | |
# Checkout | |
- uses: actions/checkout@v3 | |
# Setup | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
if: steps.tooling-cache.outputs.cache-hit != 'true' | |
with: | |
ghc-version: ${{ matrix.ghc-version }} | |
cabal-version: ${{ matrix.cabal-version }} | |
# Generate Plan | |
- name: Configure the Build | |
run: | | |
rm cabal.project.freeze | |
cabal configure --enable-tests | |
cabal build --dry-run | |
# Restore cache | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
# Build deps (for caching) | |
- name: Cabal build dependencies | |
run: cabal build all --only-dependencies | |
# Save dependency cache | |
- name: Save cache | |
uses: actions/cache/save@v3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
# Cabal build | |
- name: Cabal Bulid | |
run: | | |
cabal build all | |
# Cabal tests | |
- name: Cabal Test | |
run: | | |
cabal test all | |
build-lower-bounds: | |
name: Haskell Build (lower bounds) | |
runs-on: ubuntu-latest # or macOS-latest, or windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc-version: ['9.0.2'] | |
cabal-version: ['3.8.1.0'] | |
steps: | |
# Checkout | |
- uses: actions/checkout@v3 | |
# Setup | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
if: steps.tooling-cache.outputs.cache-hit != 'true' | |
with: | |
ghc-version: ${{ matrix.ghc-version }} | |
cabal-version: ${{ matrix.cabal-version }} | |
# Generate Plan | |
- name: Configure the Build | |
run: | | |
(cat << EOF | |
packages: . | |
constraints: | |
aeson == 2.0.3.0, | |
base == 4.15.1.0, | |
bytestring == 0.11.3.1, | |
fast-logger == 3.1.1, | |
monad-logger == 0.3.36, | |
om-show == 0.1.2.6, | |
split == 0.2.3.4, | |
text == 1.2.5.0, | |
time == 1.12.2 | |
EOF | |
) > cabal.project | |
rm cabal.project.freeze | |
cabal configure --enable-tests | |
cabal build --dry-run | |
# Restore cache | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
# Build deps (for caching) | |
- name: Cabal build dependencies | |
run: cabal build all --only-dependencies | |
# Save dependency cache | |
- name: Save cache | |
uses: actions/cache/save@v3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
# Cabal Build | |
- name: Cabal Bulid | |
run: cabal build all | |
# Cabal Test | |
- name: Cabal Test | |
run: cabal test all | |