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 a3f6232
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build application binaries via cabal

on:
workflow_dispatch:
push:
paths:
- '**'

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: Set permissions for .ghcup (ubuntu)
if: startsWith(matrix.os, 'ubuntu-')
run: sudo chown -R $USER /usr/local/.ghcup

- 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: Configure build
run: |
cabal build --dry-run
cabal freeze
- name: Sync with Cabal cache
uses: larskuhtz/cabal-cache-action@4b537195b33898fcd9adc62cee2a44986fd7b1b6
with:
bucket: "kadena-cabal-cache"
region: "us-east-1"
folder: "packages/${{ matrix.os }}"
aws_access_key_id: "${{ secrets.kadena_cabal_cache_aws_access_key_id }}"
aws_secret_access_key: "${{ secrets.kadena_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
2 changes: 1 addition & 1 deletion pact-tng.cabal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cabal-version: 3.8
cabal-version: 3.12
name: pact-tng
version: 5.0
-- ^ 4 digit is prerelease, 3- or 2-digit for prod release
Expand Down

0 comments on commit a3f6232

Please sign in to comment.