Skip to content

Commit

Permalink
Add cabal build via GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoeldner committed Jul 11, 2024
1 parent 5d76b93 commit ee48712
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build application binaries via cabal

on:
workflow_dispatch
push

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['9.6.6', '9.8.2', '9.10.1']
cabal: ['3.12']
# 'macos-14' is an M1 runner
os: ['ubuntu-20.04', 'ubuntu-22.04', 'macos-14']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install GHC and Cabal
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Confirm GHC and Cabal installation
run: |
ghc --version
cabal --version
- name: Update Cabal package database
run: cabal update

- name: Display outdated packages
run: cabal outdated

- name: Sync with Cabal cache
uses: larskuhtz/cabal-cache-action@master
with:
bucket: "my-cabal-cache-bucket"
region: "us-east-1"
folder: "${{ matrix.os }}"
aws_access_key_id: "${{ secrets.cabal_cache_aws_access_key_id }}"
aws_secret_access_key: "${{ secrets.cabal_cache_aws_secret_access_key }}"

- name: Build only dependencies
run: cabal build --only-dependencies

- name: Build application
run: cabal build

- name: Run Tests
run: cabal run tests

0 comments on commit ee48712

Please sign in to comment.