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

Updates #91

Merged
merged 16 commits into from
Jul 4, 2023
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
74 changes: 11 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@ on:

jobs:
build_and_test:
strategy:
matrix:
include:
-
stack_yaml: stack.yaml
latest: true
-
stack_yaml: stack-ghc-8.10.yaml

name: build_and_test (${{ matrix.stack_yaml }})
runs-on: ubuntu-latest
env:
STACK_YAML: ${{ matrix.stack_yaml }}

steps:
-
Expand All @@ -29,15 +17,14 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-cache-${{ hashFiles(matrix.stack_yaml, 'package.yaml') }}
key: ${{ runner.os }}-stack-cache-${{ hashFiles('stack.yaml', 'package.yaml') }}
-
name: Build + Test
run: stack test --haddock --no-haddock-deps --coverage
run: stack test --ghc-options=-Werror --haddock --no-haddock-deps --coverage
-
name: Check that files are unmodified
run: git diff --exit-code
run: git add -A && git diff --staged --exit-code
-
if: ${{ matrix.latest }}
name: Convert coverage output
run: |
HPC_LCOV_VERSION=1.1.1
Expand All @@ -47,7 +34,6 @@ jobs:
chmod +x /usr/local/bin/hpc-lcov
hpc-lcov
-
if: ${{ matrix.latest }}
uses: codecov/codecov-action@v3
with:
files: lcov.info
Expand All @@ -56,48 +42,24 @@ jobs:
strategy:
matrix:
ghc_version:
- '8.10'
- '9.0'
- '9.2'
- '9.4'
- '9.6'
include:
- ghc_version: 9.0.1
oldest: true

name: ghc_compat_test (${{ matrix.ghc_version }})
runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC ${{ matrix.ghc_version }}
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc_version }}
-
name: Configure the build
run: |
cabal configure --enable-test --test-show-details=streaming
cabal build --dry-run
-
name: Get current month to clear cache
run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
-
uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ matrix.ghc_version }}-
-
name: Build + Test
run: cabal build && cabal exec -- cabal test
uses: ./.github/workflows/ghc-compat-test.yml
with:
ghc_version: ${{ matrix.ghc_version }}
oldest: ${{ matrix.oldest || false }}

lint:
runs-on: ubuntu-latest
env:
FOURMOLU_VERSION: '0.12.0.0'
HLINT_VERSION: '3.5'
steps:
-
uses: actions/checkout@v3
Expand All @@ -111,20 +73,6 @@ jobs:
-
name: Run fourmolu
run: fourmolu -m check .
-
name: Install hlint
run: |
tmpdir=$(mktemp -d)
curl -fsSL \
"https://github.com/ndmitchell/hlint/releases/download/v${HLINT_VERSION}/hlint-${HLINT_VERSION}-x86_64-linux.tar.gz" \
-o "${tmpdir}/hlint.tar.gz"
tar xzf "${tmpdir}/hlint.tar.gz" -C "${tmpdir}"
mv "${tmpdir}/hlint-${HLINT_VERSION}/hlint" /usr/local/bin/hlint
chmod +x /usr/local/bin/hlint
rm -rf "${tmpdir}"
-
name: Run hlint
run: hlint .

benchmarks:
runs-on: ubuntu-latest
Expand All @@ -138,7 +86,7 @@ jobs:
key: ${{ runner.os }}-benchmarks-${{ hashFiles('stack.yaml', 'package.yaml') }}
-
name: Run benchmarks
run: stack bench --ba '--output=/tmp/benchmark-results.html'
run: stack bench --ghc-options=-Werror --ba '--output=/tmp/benchmark-results.html'
-
uses: actions/upload-artifact@v3
with:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/ghc-compat-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
workflow_call:
inputs:
ghc_version:
required: true
type: string
oldest:
required: false
type: boolean

jobs:
run:
runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC ${{ inputs.ghc_version }}
uses: brandonchinn178/haskell-actions-setup@ghcup-nightly
with:
ghc-version: ${{ inputs.ghc_version }}
-
name: Configure the build
run:
cabal configure
--ghc-options='-Werror -Wno-unused-packages'
--enable-test
--test-options=--color=always
--test-show-details=streaming
-
if: ${{ inputs.oldest }}
name: Use oldest dependencies
run:
cabal configure --enable-append
--prefer-oldest
--constraint 'aeson-qq >= 0.7.4'
-
if: ${{ inputs.ghc_version == 'latest-nightly' }}
name: Add head.hackage
run: |
curl -fsSL -o /tmp/head.hackage.sh https://gitlab.haskell.org/ghc/head.hackage/-/raw/master/scripts/head.hackage.sh
bash /tmp/head.hackage.sh dump-repo >> cabal.project.local
cabal update
-
name: Get build plan
run: cabal build --dry-run
-
name: Get current month to clear cache
run: echo "CURR_MONTH=$(date +%B)" | tee -a "$GITHUB_ENV"
-
uses: actions/cache@v3
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ inputs.ghc_version }}-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-cabal-cache-${{ env.CURR_MONTH }}-${{ inputs.ghc_version }}-
-
name: Build + Test
run: cabal build && cabal exec -- cabal test
-
name: Check that files are unmodified
run: git add -A && git diff --staged --exit-code
14 changes: 14 additions & 0 deletions .github/workflows/ghc-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test against GHC nightly release
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # nightly

jobs:
test_ghc_nightly:
uses: ./.github/workflows/ghc-compat-test.yml
with:
ghc_version: latest-nightly
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 changes: 0 additions & 17 deletions .hlint.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Drop support for GHC 8.10

# v1.4.1.0

* Add support for GHC 9.6
Expand Down
7 changes: 0 additions & 7 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ stack build --haddock

The following linters must pass CI in order for your PR to be accepted.

* HLint

```bash
cabal install hlint-3.5
hlint .
```

* fourmolu

```bash
Expand Down
56 changes: 21 additions & 35 deletions aeson-schemas.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ extra-source-files:
test/goldens/getqq_no_operators.golden
test/goldens/getqq_ops_after_list.golden
test/goldens/getqq_ops_after_tuple.golden
test/goldens/integration/ghc-8.10/getqq_missing_key.golden
test/goldens/integration/ghc-9.0/getqq_missing_key.golden
test/goldens/integration/ghc-9.2/getqq_missing_key.golden
test/goldens/integration/ghc-9.4/getqq_missing_key.golden
test/goldens/ghc/9.0/getqq_missing_key.golden
test/goldens/ghc/9.2/getqq_missing_key.golden
test/goldens/ghc/9.4/getqq_missing_key.golden
test/goldens/ghc/9.6/getqq_missing_key.golden
test/goldens/ghc/9.7/getqq_missing_key.golden
test/goldens/README_Quickstart.golden
test/goldens/schemaqq_key_with_invalid_character.golden
test/goldens/schemaqq_key_with_trailing_escape.golden
Expand All @@ -55,10 +56,6 @@ source-repository head
type: git
location: https://github.com/brandonchinn178/aeson-schemas

flag run-integration-tests
manual: True
default: False

library
exposed-modules:
Data.Aeson.Schema
Expand All @@ -81,21 +78,17 @@ library
Data.Aeson.Schema.TH.Utils
hs-source-dirs:
src
ghc-options: -Wall
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances -Wunused-packages
build-depends:
aeson >=1.1.2.0 && <3
, base >=4.14 && <5
, first-class-families >=0.3.0.0 && <0.9
, hashable >=1.2.7.0 && <1.5
, megaparsec >=7 && <10
, template-haskell >=2.16 && <2.21
, text >=1.2.2.2 && <2.1
, unordered-containers >=0.2.8.0 && <0.3
aeson <3
, base >=4.15 && <5
, first-class-families <0.9
, hashable <1.5
, megaparsec <10
, template-haskell <2.21
, text <2.1
, unordered-containers <0.3
default-language: Haskell2010
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

test-suite aeson-schemas-test
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -124,35 +117,32 @@ test-suite aeson-schemas-test
Paths_aeson_schemas
hs-source-dirs:
test
ghc-options: -Wall
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances -Wunused-packages
build-depends:
QuickCheck
, aeson
, aeson-qq
, aeson-schemas
, base
, deepseq
, directory
, filepath
, hint
, interpolate
, process
, raw-strings-qq
, tasty
, tasty-golden
, tasty-hunit
, tasty-quickcheck
, tasty-quickcheck >=0.8.1
, template-haskell
, temporary
, text
, th-orphans
, th-test-utils
default-language: Haskell2010
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if flag(run-integration-tests)
cpp-options: -DRUN_INTEGRATION_TESTS
if impl(ghc < 9.2)
build-depends:
hint <0.9.0.6

benchmark aeson-schemas-bench
type: exitcode-stdio-1.0
Expand All @@ -169,7 +159,7 @@ benchmark aeson-schemas-bench
Paths_aeson_schemas
hs-source-dirs:
bench
ghc-options: -Wall
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances -Wunused-packages
build-depends:
aeson
, aeson-schemas
Expand All @@ -179,7 +169,3 @@ benchmark aeson-schemas-bench
, template-haskell
, th-test-utils
default-language: Haskell2010
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
1 change: 1 addition & 0 deletions bench/Benchmarks/Data/Objects.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

module Benchmarks.Data.Objects where

Expand Down
4 changes: 0 additions & 4 deletions cabal.project

This file was deleted.

Loading