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

Prepare for release 0.2.0 #68

Merged
merged 1 commit into from
Nov 8, 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
73 changes: 23 additions & 50 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# 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
#
# haskell-ci regenerate
#
# 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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
194 changes: 194 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -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

10 changes: 4 additions & 6 deletions demo/demo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 5 additions & 7 deletions lib/falsify.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/src/Test/Falsify/Internal/Range.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import GHC.Show
import GHC.Stack

{-------------------------------------------------------------------------------
Proper frations
Proper fractions
-------------------------------------------------------------------------------}

-- | Value @x@ such that @0 <= x < 1@
Expand Down