Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update CI to add GHC 9.8 #34

Merged
merged 1 commit into from
May 2, 2024
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
202 changes: 115 additions & 87 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,113 +19,141 @@ env:

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} / cabal-${{ matrix.cabal }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["3.8.1.0"]
cabal: ["3.8", "latest"]
ghc:
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"
- "9.8"
exclude:
# macos llvm issue for versions less than 9.2
- os: macos-latest
ghc: "8.10"
- os: macos-latest
ghc: "9.0"
# Cabal 3.8 supports GHC < 9.6
- cabal: "3.8"
ghc: "9.6"
- cabal: "3.8"
ghc: "9.8"

steps:
- uses: actions/checkout@v3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/dev'

- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct

- name: Freeze
run: |
cabal freeze

- uses: actions/cache@v3
name: Cache ~/.cabal/store and dist-newstyle
with:
path: |
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-

- name: Install dependencies
run: |
cabal build all --only-dependencies

- name: Build
run: |
cabal build all

- name: Test
if: ${{ env.SENDGRID_API_KEY != '' && env.SENDGRID_TEST_MAIL != '' }}
run: |
cabal test all

- name: Documentation
run: |
cabal haddock
- uses: actions/checkout@v4
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/dev'

- uses: haskell-actions/setup@v2
id: setup
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true

- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.

- name: Restore cached dependencies
uses: actions/cache/restore@v4
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') }}
restore-keys: ${{ env.key }}-

- name: Install dependencies
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v4
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Build
run: |
cabal build all

- name: Test
if: ${{ env.SENDGRID_API_KEY != '' && env.SENDGRID_TEST_MAIL != '' }}
run: |
cabal test all

- name: Check cabal file
run: cabal check

- name: Build documentation
run: cabal haddock all

stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc:
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"
- "9.8"
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/dev'

- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
enable-stack: true
ghc-version: ${{ matrix.ghc }}
stack-version: latest

- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-
- uses: actions/cache@v3
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-

- name: Install dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies

- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks

- name: Test
if: ${{ env.SENDGRID_API_KEY != '' && env.SENDGRID_TEST_MAIL != '' }}
run: |
stack test --system-ghc

- name: Documentation
run: |
stack haddock --system-ghc --no-haddock-deps
- uses: actions/checkout@v4
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/dev'

- uses: haskell-actions/setup@v2
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-version: latest

- uses: actions/cache@v4
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-
- uses: actions/cache@v4
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-

- name: Install dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies

- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks

- name: Test
if: ${{ env.SENDGRID_API_KEY != '' && env.SENDGRID_TEST_MAIL != '' }}
run: |
stack test --system-ghc

- name: Documentation
run: |
stack haddock --system-ghc --no-haddock-deps
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SendGrid-v3
[![Build Status](https://travis-ci.org/marcelbuesing/sendgrid-v3.svg?branch=dev)](https://travis-ci.org/marcelbuesing/sendgrid-v3)
[![CI](https://github.com/marcelbuesing/sendgrid-v3/actions/workflows/ci.yml/badge.svg)](https://github.com/marcelbuesing/sendgrid-v3/actions/workflows/ci.yml/badge.svg)[![Hackage](https://img.shields.io/hackage/v/sendgrid-v3.svg)](https://hackage.haskell.org/package/sendgrid-v3)

A library for accessing the [v3 SendGrid API](https://sendgrid.com/docs/API_Reference/api_v3.html) in Haskell.

Expand Down
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

20 changes: 9 additions & 11 deletions sendgrid-v3.cabal
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- Initial sendgrid-v3.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/

cabal-version: 2.4
name: sendgrid-v3
version: 1.0.0.1
version: 1.1.0.0
synopsis: Sendgrid v3 API library
description: SendGrid v3 Mail API client
homepage: https://github.com/marcelbuesing/sendgrid-v3
Expand All @@ -14,13 +12,13 @@ maintainer: buesing.marcel@googlemail.com
category: Network
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
tested-with:
GHC ==8.10.7
|| ==9.0.2
|| ==9.2.7
|| ==9.4.4
|| ==9.6.1
tested-with: GHC == 8.10.7
, GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.8
, GHC == 9.6.5
, GHC == 9.8.2

source-repository head
type: git
location: https://github.com/marcelbuesing/sendgrid-v3
Expand Down
67 changes: 0 additions & 67 deletions stack-8.8.yaml

This file was deleted.