From d4cf4ec64fc9aaf7a30faa73ffa70bab70129432 Mon Sep 17 00:00:00 2001 From: Edsko de Vries Date: Wed, 8 Nov 2023 14:38:30 +0100 Subject: [PATCH] Prepare for release 0.2.0 --- .github/workflows/haskell-ci.yml | 73 +++------- cabal.haskell-ci | 194 +++++++++++++++++++++++++ demo/demo.cabal | 10 +- lib/CHANGELOG.md | 6 +- lib/falsify.cabal | 12 +- lib/src/Test/Falsify/Internal/Range.hs | 2 +- 6 files changed, 230 insertions(+), 67 deletions(-) create mode 100644 cabal.haskell-ci diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index a4a2c89..862bf3d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci 'github' '--no-cabal-check' 'cabal.project.ci' +# haskell-ci 'github' 'cabal.project.ci' # # To regenerate the script (for example after adjusting tested-with) run # @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.15.20230321 +# version: 0.17.20231106 # -# REGENDATA ("0.15.20230321",["github","--no-cabal-check","cabal.project.ci"]) +# REGENDATA ("0.17.20231106",["github","cabal.project.ci"]) # name: Haskell-CI on: @@ -28,19 +28,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.6.1 + - compiler: ghc-9.6.3 compilerKind: ghc - compilerVersion: 9.6.1 + compilerVersion: 9.6.3 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.4 + - compiler: ghc-9.4.7 compilerKind: ghc - compilerVersion: 9.4.4 + compilerVersion: 9.4.7 setup-method: ghcup allow-failure: false - - compiler: ghc-9.2.5 + - compiler: ghc-9.2.8 compilerKind: ghc - compilerVersion: 9.2.5 + compilerVersion: 9.2.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.0.2 @@ -53,37 +53,17 @@ jobs: compilerVersion: 8.10.7 setup-method: ghcup allow-failure: false - - compiler: ghc-8.8.4 - compilerKind: ghc - compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.6.5 - compilerKind: ghc - compilerVersion: 8.6.5 - setup-method: hvr-ppa - allow-failure: false fail-fast: false steps: - name: apt run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y "$HCNAME" - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -95,20 +75,13 @@ jobs: echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - if [ "${{ matrix.setup-method }}" = ghcup ]; then - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" @@ -158,8 +131,8 @@ jobs: - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c - + curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz + echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 0000000..614ff18 --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1,194 @@ +-- cabal-install version for all jobs +cabal-install-version: 3.10 + +-- jobs (N:M - cabal:ghc) +jobs: + +-- distribution version (xenial, bionic, focal, jammy) +distribution: bionic + +-- Jobs selection across packages +jobs-selection: uniform + +-- Restrict jobs selection futher from per package tested-with +enabled: True + +-- Copy ? fields from cabal.project fields +copy-fields: some + +-- --ghc-options for local packages +local-ghc-options: + +-- Clone submodules, i.e. recursively +submodules: False + +-- Disable caching +cache: True + +-- Skip separate dependency installation step +install-dependencies: True + +-- Specify 'constraint: ... installed' packages +installed: + +-- Build tests with +tests: True + +-- Run tests with (note: only built tests are run) +run-tests: True + +-- Build benchmarks +benchmarks: True + +-- Haddock step +haddock: True + +-- Haddock components +haddock-components: all + +-- Build without tests and benchmarks +no-tests-no-benchmarks: True + +-- Make unconstrained build +unconstrained: True + +-- Use head.hackage repository. Also marks as allow-failures +head-hackage: >=9.9 + +-- Use :override for head.hackage repository +head-hackage-override: True + +-- Run tests with GHCJS (experimental, relies on cabal-plan finding test-suites) +ghcjs-tests: False + +ghcjs-tools: + +-- Use --test-show-details=direct, may cause problems with build-type: Custom +test-output-direct: True + +-- Disable cabal check run +cabal-check: False + +-- Enable builds only for specific branches +branches: + +-- Enable IRC notifications to given channel (e.g. 'irc.libera.chat#haskell-lens') +irc-channels: + +-- Nickname with which to authenticate to an IRC server. Only used if `irc-channels` are set. +irc-nickname: + +-- Password with which to authenticate to an IRC server. Only used if `irc-channels` are set. +irc-password: + +-- Only send IRC notifications if run from the original remote (GitHub Actions only) +irc-if-in-origin-repo: False + +-- Disable email notifications +email-notifications: True + +-- Project name (used for IRC notifications), defaults to package name or name of first package listed in cabal.project file +project-name: + +-- Build steps to fold +folds: + +-- Add ghc-head job +ghc-head: False + +-- Add postgresql service +postgresql: False + +-- Add google-chrome service +google-chrome: False + +-- Environment variables per job (e.g. `8.0.2:HADDOCK=false`) +env: + +-- Allow failures of particular GHC version +allow-failures: False + +-- [Discouraged] Assume there are only GHCs last in major series: 8.2.* will match only 8.2.2 +last-in-series: False + +-- Jobs to build on Linux +linux-jobs: True + +-- Jobs to additionally build with OSX +macos-jobs: False + +-- Use (or don't) ghcup to install cabal +ghcup-cabal: True + +-- (Linux) jobs to use ghcup to install tools +ghcup-jobs: >8.10.4 && <9 || >9.0.1 + +-- ghcup version +ghcup-version: 0.1.19.5 + +-- Additional apt packages to install +apt: + +travis-patches: + +github-patches: + +-- Don't insert the haskell-ci version into the generated Travis YAML file +insert-version: True + +-- Insert -Werror=missing-methods for package scope (none, local, all) +error-missing-methods: local + +-- Enable Doctest job +doctest: False + +-- Additional Doctest options +doctest-options: + +-- Doctest version +doctest-version: ^>=0.21.0 + +-- Filter packages from .ghc.environment file +doctest-filter-packages: + +-- Skip doctests for these packages +doctest-skip: + +-- Enable Docspec job +docspec: False + +-- Additional Docspec options +docspec-options: + +-- URL to download cabal-docspec +docspec-url: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20230517/cabal-docspec-0.0.0.20230517-x86_64-linux.xz + +-- SHA256 of cabal-docspec +docspec-hash: 3b31bbe463ad4d671abbc103db49628562ec48a6604cab278207b5b6acd21ed7 + +-- Enable HLint job +hlint: False + +-- Specify HLint job +hlint-job: latest + +hlint-yaml: + +-- Additional HLint options +hlint-options: + +-- HLint version +hlint-version: >=3.5 && <3.6 + +-- Download HLint binary release +hlint-download-binary: True + +-- Raw travis commands which will be run at the very end of the script +raw-travis: + +-- The name of GitHub Action +github-action-name: + +-- The maximum number of minutes to let a job run +timeout-minutes: 60 + diff --git a/demo/demo.cabal b/demo/demo.cabal index 0cc272c..403d639 100644 --- a/demo/demo.cabal +++ b/demo/demo.cabal @@ -7,13 +7,11 @@ author: Edsko de Vries maintainer: edsko@well-typed.com category: Testing build-type: Simple -tested-with: GHC==8.6.5 - , GHC==8.8.4 - , GHC==8.10.7 +tested-with: GHC==8.10.7 , GHC==9.0.2 - , GHC==9.2.5 - , GHC==9.4.4 - , GHC==9.6.1 + , GHC==9.2.8 + , GHC==9.4.7 + , GHC==9.6.3 common lang ghc-options: diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 87443e9..988aff6 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,14 +1,14 @@ # Revision history for falsify -## 0.2 -- unreleased +## 0.2.0 -- 2023-11-08 * Avoid use of `Expr` in `at` (#48) -* Add `oneof` (#54, Simon Kohlmeyer) +* Add `oneof` (#54; Simon Kohlmeyer) * Generalize `Range`, so that it can be used for types like `Char` (#51). As a consequence, `Gen.integral` and `Gen.enum` are now deprecated, and superseded by `Gen.inRange`. * Add `GenDefault` class and `DerivingVia` helpers to derive generators - (#61, #64). + (Eric Conlon; #61, #64). ## 0.1.1 -- 2023-04-07 diff --git a/lib/falsify.cabal b/lib/falsify.cabal index 84e422d..f0ffef1 100644 --- a/lib/falsify.cabal +++ b/lib/falsify.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: falsify -version: 0.1.1 +version: 0.2.0 synopsis: Property-based testing with internal integrated shrinking description: This library provides property based testing with support for internal integrated shrinking: integrated in the sense @@ -25,13 +25,11 @@ copyright: Well-Typed LLP category: Testing build-type: Simple extra-doc-files: CHANGELOG.md -tested-with: GHC==8.6.5 - , GHC==8.8.4 - , GHC==8.10.7 +tested-with: GHC==8.10.7 , GHC==9.0.2 - , GHC==9.2.5 - , GHC==9.4.4 - , GHC==9.6.1 + , GHC==9.2.8 + , GHC==9.4.7 + , GHC==9.6.3 source-repository head type: git diff --git a/lib/src/Test/Falsify/Internal/Range.hs b/lib/src/Test/Falsify/Internal/Range.hs index d525329..e549b38 100644 --- a/lib/src/Test/Falsify/Internal/Range.hs +++ b/lib/src/Test/Falsify/Internal/Range.hs @@ -12,7 +12,7 @@ import GHC.Show import GHC.Stack {------------------------------------------------------------------------------- - Proper frations + Proper fractions -------------------------------------------------------------------------------} -- | Value @x@ such that @0 <= x < 1@