diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml new file mode 100644 index 000000000..d98da474f --- /dev/null +++ b/.github/workflows/cabal.yml @@ -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