Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on:
- push
- pull_request

jobs:
generate-matrix:
name: Generate GHC matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-tested.outputs.matrix }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: get-tested
uses: Kleidukos/get-tested@a55a250eac23bcc4bcd1cb22d77be61baea5a7e2 # v0.1.9.1
with:
cabal-file: smtp-mail.cabal
ubuntu-version: "latest"

build:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: haskell/ghcup-setup@2860d0b41e2c5aa7d005bcbc2bd2506a09557ed8 # v1.2.2
with:
ghc: ${{ matrix.ghc }}
cabal: latest
- name: Update cabal index
run: cabal update
- name: Get cabal store path
id: cabal-store
run: echo "path=$(cabal path --store-dir)" >> "$GITHUB_OUTPUT"
- name: Restore cache
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.cabal-store.outputs.path }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }}
- name: Build dependencies
run: cabal build all --only-dependencies
- name: Save cache
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.cabal-store.outputs.path }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }}
- name: Build
run: cabal build all

all-builds:
name: All builds passed
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Check build results
run: |
if [[ "${{ needs.build.result }}" != "success" ]]; then
echo "One or more builds failed"
exit 1
fi
193 changes: 0 additions & 193 deletions .github/workflows/haskell-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion smtp-mail.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maintainer: spencerjanssen@gmail.com
category: Network
build-type: Simple
cabal-version: 2.0
tested-with: GHC ==9.12.2
tested-with: GHC ==9.8.4, GHC ==9.10.3, GHC ==9.12.2

extra-source-files:
README.md
Expand Down
Loading