Skip to content

Merge pull request #27 from rickowens/pr #7

Merge pull request #27 from rickowens/pr

Merge pull request #27 from rickowens/pr #7

Workflow file for this run

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'
cabal-version: ['3.10.2.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:
async == 2.2.4,
base == 4.15.1.0,
bytestring == 0.10.12.1,
directory == 1.3.6.2,
filepath == 1.4.2.1,
http-types == 0.12.3,
mime-types == 0.1.1.0,
monad-logger == 0.3.37,
network == 3.1.2.7,
om-show == 0.1.2.6,
safe-exceptions == 0.1.7.3,
servant == 0.19,
template-haskell == 2.17.0.0,
text == 1.2.5.0,
time == 1.9.3,
unix == 2.7.2.2,
uuid == 1.3.15,
wai == 3.2.3,
warp == 3.3.23
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