diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69027e1..2f707d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 221be2e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: haskell -cache: - directories: - - "$HOME/.cabal/store" - - "$HOME/.stack" - - "$TRAVIS_BUILD_DIR/.stack-work" -cabal: "3.2" -matrix: - include: - - env: GHCVER=8.6.5 STACK_YAML=stack.yaml - ghc: 8.6.5 - - env: GHCVER=8.8.3 STACK_YAML=stack-8.8.yaml - ghc: 8.8.3 -# Make sure to update the version condition in the deploy step - - env: GHCVER=8.10.3 - ghc: 8.10.3 -before_install: -- mkdir -p ~/.local/bin -- export PATH=$HOME/.local/bin:$PATH -- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards - --strip-components=1 -C ~/.local/bin '*/stack' -- stack config set system-ghc --global true -- export PATH=/opt/ghc/$GHCVER/bin:$PATH -install: - - | - if [ -z "$STACK_YAML" ]; then - ghc --version - cabal --version - cabal new-update - cabal new-build --enable-tests - else - stack --version - stack build --system-ghc --test --no-run-tests - fi -script: -- | - if [ -z "$STACK_YAML" ]; then - cabal new-test --enable-tests - else - stack --no-terminal test --system-ghc - fi -env: - global: - - secure: lMVWRVzRUVsbxp1Zce9ezxCRaaFR/+UVpbWT+ElvTQz+1kSs1CccGdMdocKD2edY2mt0hhXDe3jpaZMnW7sTBkrivg76MdAb2UyZDjzj0xXUpcbUB1pweaFGWxE9HkpIq+fb0NkajWgw1wpZqk/+vjU/8RMPBvDkvIHQRtYewY1nnPDpDPP4nUqnKNdPOlDKRsHY66l+XN6ukxXFCqb0PBl4qmzzgbwHpLxNBPgACtPcd4m7wVLVyl1tdiektWhblO4gXME0B8Qm9Ggq1Bbjj0FOqX/rHSalzOpOBeMK8b1hxHehFSkr+Zjqwn34c7IMAZ5zjuOG7vUeHR6iIjtgDSBEPCMsWze/4vb6JGl679LISZ3IQuabBf7sJGfyuCzVLQviCqqDMdzWDPPHNkUmeBGqQUW+awwZBygUTj3dMH2AFDtq1iN0crgxtP9m+awVb+dGpiMfV3iWefiO7ADVvz1Bs+pkmHfJWD0nRDm2rtOw/iRimVnFtfa6QYr53uYnNKTYkqGT65ca4m87+lIwWqU0z5184KTSqHiebZE7/qTZovcwKymM0lW6YdOeMI+O252DbOowaTDIcpNIoDEjtueIfgNhi1T79Es8m8MFvtRWqPCHLm3aTVQwsT0LWR7DAGA95URFG6Cbz811IMWzC2L1cGcT7ELdcmXpTDm7zlg= - - secure: p4LgpIgqOy5LVThcvotfTqPCDXti8QnlJT7f+EVMogzP8pZXaxT/zBy1iBaRgVVUg7GaDFAOly4LhFDOJHVdsMeXWWZW7zw8awxvzrQr48mS+LeOTjgZs5o9mAcRxc28YzRElWen0yrIXCMb2h8Pn/eJrhijS4xq30AsBlp/tT1QvARicz+VMk2bFiei+9RL3F/TbSPH8rHhUPSE4rS90rioELfErwZ50H4z95khhbd/TH8P8t05F5OXQtKIyaCz9uBIk1R9NDYFLtREjtslldYlOrbml5i7rwJEAnGSp/HeXXy59YUBS32iZVvgLELeTLonVFHIcAU6lBuYG2dScoQolBi0h3MY1u0RORO1ZnNgKfIbhFpRL44I+vRZFyJPIAy/ojcGy6UOpuVieWjCDshWqlTBNM6F70sLMZ4KJcb05Pig55bEP1Ya3A4GlAbzAuVrPTFKQLwNtILDpCDlYsZ1nHtL/pgbKdHK01x8FdFTnb4WWpa+yRweSZRbABctrNl7pDJwC12eFIzT+a06RusspmAqUVdWA/RrdxHyIVmaCGutK3eMbOHhGpczRIddfG/RLogGr5nyfcmcSWB6WRbvdfNtvrssc97I0MvVtn2fY58O2FuvzHiUZJs4831WWHez/5/n0670ZZvWFUYu01VvUThk/rgP/n6i/G1sVY0= -deploy: - provider: hackage - username: buesing.marcel@googlemail.com - password: - secure: aZypeaEDipQGHXbmmZR1Q85X4Zj1uwzjgcTjcJrAY+q1RW5WZMvg7oIniZAcb6TnBENQbCkyWp2POp+Zoi5teXUsAuDy9GTR/oMb71Xhp7V6aJ3X/Jwvhlek5aQ9drbV5hT/N/DjHTfEgUhRA7/YYAJw5Wm0Y9v+ingo56NO21Wj5iT08EV1oGrARFEYFZj5ja4NZfj3NM3OiOFmiXaAcgPCWljQy6wtJYPrr4O0PrvFodMqUzBnbLwDtAcHaQU47IAxDzatTCT4CIXwDhMLQbYIxVzwwx6Mh2wOh4lePSrFvjh5ajhfW4y3KRNlp6bG5mtaQ0wjNXZ6vTk6tdgODT0qBnawNLJ9VSYDvo2b3V9eR+/RS69glTdaXcfORqzOJvqLAWAFypiJSzz/9eg1dv0hMfhTh59vYQ59k0P8ILhaxeEDL1DlZ87SQe4282f4KvzeofG7W/XIxjLQYQypdJXD/DsJrkSWzI5dI9xBBE0yofeqHSkg1YbfB1st23Psh4LuZglO1NKyQx5OFTn8Wi+K2EFd5/wHG0rLZjYuND3PMzwv/O7MZzpqwvSjRBFxHy8Z7S6Cb38jpr5+tbUyvdlItp/zbeOvU9h5RQ+Ct+7QFWc3mpV9OuA0oD24lEcxfXQB/X9nR+EJxoB3cruID0drqqw6tVVtNyIPMmqNIW0= - on: - repo: marcelbuesing/sendgrid-v3 - tags: true - condition: $TRAVIS_HASKELL_VERSION = 8.10.3 diff --git a/README.md b/README.md index 296e4d7..9dc6c92 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/Setup.hs b/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/sendgrid-v3.cabal b/sendgrid-v3.cabal index ca2d0e6..66b92f0 100644 --- a/sendgrid-v3.cabal +++ b/sendgrid-v3.cabal @@ -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 @@ -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 diff --git a/stack-8.8.yaml b/stack-8.8.yaml deleted file mode 100644 index efe9257..0000000 --- a/stack-8.8.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# https://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# resolver: ghcjs-0.1.0_ghc-7.10.2 -# resolver: -# name: custom-snapshot -# location: "./custom-snapshot.yaml" -resolver: lts-15.12 - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# - location: -# git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# extra-dep: true -# subdirs: -# - auto-update -# - wai -# -# A package marked 'extra-dep: true' will only be built if demanded by a -# non-dependency (i.e. a user package), and its test suites and benchmarks -# will not be run. This is useful for tweaking upstream packages. -packages: -- . -# Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) -extra-deps: [] - - -# Override default flag values for local packages and extra-deps -# flags: {} - -# Extra package databases containing global packages -# extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=1.6" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor