From 6542e09281c7a07b591a4418ea5df51cdd95d860 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 29 Aug 2023 15:18:27 -0400 Subject: [PATCH 1/3] Add CI --- .github/workflows/haskell.yml | 45 +++++++++++++++++++++++++++++++++++ cabal.project | 4 ++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/haskell.yml create mode 100644 cabal.project diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..90b5eb6 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,45 @@ +name: github-action + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.2'] + os: ['ubuntu-latest', 'macos-latest'] + exclude: + # There are some linker warnings in 802 on darwin that + # cause compilation to fail + # See https://github.com/NixOS/nixpkgs/issues/25139 + - ghc: '8.0.2' + os: 'macos-latest' + runs-on: ${{ matrix.os }} + + name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-haskell@v1 + with: + ghc-version: ${{ matrix.ghc }} + - name: Cache + uses: actions/cache@v1 + env: + cache-name: cache-cabal + with: + path: ~/.cabal + key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}- + ${{ runner.os }}-${{ matrix.ghc }}-build- + ${{ runner.os }}-${{ matrix.ghc }}- + ${{ runner.os }} + + - name: Install dependencies + run: | + cabal update + cabal build --only-dependencies --enable-tests --enable-benchmarks all + - name: Build + run: cabal build --enable-tests --enable-benchmarks all + - name: Run tests + run: cabal test all diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..b3a7351 --- /dev/null +++ b/cabal.project @@ -0,0 +1,4 @@ +packages: + class/ + groundhog/ + obelisk/ From 5a7c6fcee6651fc1ae5fda7c9969c3585fa16084 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 29 Aug 2023 18:06:42 -0400 Subject: [PATCH 2/3] Skip old GHC, raise `base` max version --- .github/workflows/haskell.yml | 2 +- class/database-id-class.cabal | 2 +- groundhog/database-id-groundhog.cabal | 2 +- obelisk/database-id-obelisk.cabal | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 90b5eb6..ee67dff 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.2'] + ghc: ['8.6.5', '8.8.4', '8.10.2'] os: ['ubuntu-latest', 'macos-latest'] exclude: # There are some linker warnings in 802 on darwin that diff --git a/class/database-id-class.cabal b/class/database-id-class.cabal index 8edd7bd..24ead3c 100644 --- a/class/database-id-class.cabal +++ b/class/database-id-class.cabal @@ -16,7 +16,7 @@ extra-source-files: CHANGELOG.md library exposed-modules: Database.Id.Class - build-depends: base >=4.11 && <4.14 + build-depends: base >=4.11 && <4.15 , aeson hs-source-dirs: src default-language: Haskell2010 diff --git a/groundhog/database-id-groundhog.cabal b/groundhog/database-id-groundhog.cabal index 460f1fa..a996a4c 100644 --- a/groundhog/database-id-groundhog.cabal +++ b/groundhog/database-id-groundhog.cabal @@ -18,7 +18,7 @@ library , Database.Id.Groundhog.TH other-extensions: QuasiQuotes , TemplateHaskell - build-depends: base >=4.11 && <4.13 + build-depends: base >=4.11 && <4.15 , aeson , database-id-class , groundhog <= 0.7.0.3 diff --git a/obelisk/database-id-obelisk.cabal b/obelisk/database-id-obelisk.cabal index 9bfbe79..ca5d1c4 100644 --- a/obelisk/database-id-obelisk.cabal +++ b/obelisk/database-id-obelisk.cabal @@ -15,7 +15,7 @@ extra-source-files: CHANGELOG.md library exposed-modules: Database.Id.Obelisk.Route - build-depends: base >=4.11 && <4.13 + build-depends: base >=4.11 && <4.15 , obelisk-route , database-id-class , mtl From 4bfcc4c9b7d52e463f7ac36a1474a391d63a29f9 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 30 Aug 2023 12:10:13 -0400 Subject: [PATCH 3/3] Drop GHC 8.10 for now --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index ee67dff..4d954c5 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - ghc: ['8.6.5', '8.8.4', '8.10.2'] + ghc: ['8.6.5', '8.8.4'] os: ['ubuntu-latest', 'macos-latest'] exclude: # There are some linker warnings in 802 on darwin that