Skip to content
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
34 changes: 0 additions & 34 deletions .github/workflows/build.yml

This file was deleted.

108 changes: 108 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build and Test

on:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

defaults:
run:
shell: bash

jobs:
find-stack-yamls:
name: Find stack.yamls for GHC Matrix
runs-on: ubuntu-22.04
outputs:
stack-yamls: ${{ steps.set-output.outputs.stack-yamls }}
steps:
- name: Find Stack Yamls
id: set-output
uses: flipstone/github-actions/find-stack-ghc-yamls@bef3396e6c3777767d1d4837203cfdb2635b4933

build:
name: Build and Test
needs: find-stack-yamls
runs-on: ubuntu-22.04
strategy:
max-parallel: 5
matrix:
stack-yaml: ${{ fromJson(needs.find-stack-yamls.outputs.stack-yamls) }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v4
env:
cache-version: v3
with:
key: ${{ env.cache-version }}-${{ matrix.stack-yaml }}-${{ hashFiles(matrix.stack-yaml, 'stack-base.yaml', 'package.yaml') }}
restore-keys: |
${{ env.cache-version }}-${{ matrix.stack-yaml }}-
path: |
./stack-root

- name: Setup Stack
uses: flipstone/github-actions/setup-dockerized-stack@bef3396e6c3777767d1d4837203cfdb2635b4933
with:
stack-root: ./stack-root

- name: Build and test
run: ./scripts/test --stack-yaml ${{ matrix.stack-yaml }}

formatting-check:
name: Formatting Check
runs-on: ubuntu-22.04
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@bef3396e6c3777767d1d4837203cfdb2635b4933
with:
stack-root: ./stack-root

- name: Format and Check for Diff
run: ./scripts/format-repo

cabal-check:
name: Cabal Check
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@bef3396e6c3777767d1d4837203cfdb2635b4933
with:
stack-root: ./stack-root

- name: Check for Hackage releasable issues
run: docker compose run --rm dev cabal check

cabal-latest-build:
name: Cabal Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@bef3396e6c3777767d1d4837203cfdb2635b4933
with:
stack-root: ./stack-root

- name: Build with cabal and latest ghc+deps
# When a new ghc version is released, we might not be able to build all the dependencies for
# a little while. So we need to allow failure here. It is a very unfortunate situation that
# github does not give us a better UX for this as the closest thing to a required check is
# not configured here, but seemingly only through the api/webui for "branch protection"
continue-on-error: true
run: scripts/cabal-latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.stack-work/
*~
.env
test-all-logs/
5 changes: 0 additions & 5 deletions compose.override.github.yml

This file was deleted.

12 changes: 9 additions & 3 deletions optparse-repl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: optparse-repl
version: 0.1.0.2
version: 0.1.0.3
description: Please see the README on GitHub at <https://github.com/githubuser/optparse-repl#readme>
homepage: https://github.com/flipstone/optparse-repl#readme
bug-reports: https://github.com/flipstone/optparse-repl/issues
Expand Down Expand Up @@ -37,10 +37,16 @@ library
build-depends:
base >=4.7 && <5
, isocline ==1.0.*
, optparse-applicative >=0.17 && <0.19
, optparse-applicative >=0.16 && <0.19
, safe-exceptions ==0.1.*
default-language: Haskell2010
if flag(strict)
ghc-options: -Weverything -Werror -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-missing-kind-signatures -Wno-prepositive-qualified-module -Wno-implicit-prelude -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-missing-deriving-strategies -Wno-all-missed-specialisations -Wno-missed-specialisations
ghc-options: -Weverything -Werror -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-implicit-prelude -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-missing-deriving-strategies -Wno-all-missed-specialisations -Wno-missed-specialisations
if impl (ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
if impl (ghc >= 9.8)
ghc-options: -Wno-missing-role-annotations -Wno-missing-poly-kind-signatures
if impl (ghc >= 9.10)
ghc-options: -Wno-defaulted-exception-context
else
ghc-options: -Wall
19 changes: 16 additions & 3 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: optparse-repl
version: 0.1.0.2
version: 0.1.0.3
github: "flipstone/optparse-repl"
license: MIT
author: "Flipstone Technology Partners"
Expand All @@ -18,10 +18,13 @@ extra-source-files:
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/githubuser/optparse-repl#readme>

tested-with:
GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.7, GHC == 9.8.4, GHC == 9.10.2

dependencies:
- base >= 4.7 && < 5
- isocline >= 1.0 && < 1.1
- optparse-applicative >= 0.17 && < 0.19
- optparse-applicative >= 0.16 && < 0.19
- safe-exceptions >= 0.1 && < 0.2

flags:
Expand All @@ -38,7 +41,6 @@ when:
- -Werror
- -Wno-missing-local-signatures
- -Wno-monomorphism-restriction
- -Wno-missing-kind-signatures
- -Wno-prepositive-qualified-module
- -Wno-implicit-prelude
- -Wno-safe
Expand All @@ -47,6 +49,17 @@ when:
- -Wno-missing-deriving-strategies
- -Wno-all-missed-specialisations
- -Wno-missed-specialisations
when:
- condition: impl (ghc >= 9.2)
ghc-options:
- -Wno-missing-kind-signatures
- condition: impl (ghc >= 9.8)
ghc-options:
- -Wno-missing-role-annotations
- -Wno-missing-poly-kind-signatures
- condition: impl (ghc >= 9.10)
ghc-options:
- -Wno-defaulted-exception-context
else:
ghc-options:
- -Wall
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
source scripts/lib/run-in-container.sh

./scripts/format-repo
./scripts/test
./scripts/test-all
1 change: 1 addition & 0 deletions scripts/format-repo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
source scripts/lib/run-in-container.sh

if [ "$CI" ]; then
git config --global --add safe.directory $PWD
MODE=check
else
MODE=inplace
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/run-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ if [ "$IN_DEV_CONTAINER" ]; then
:
else
docker compose build
exec docker compose run dev $0 "$@"
exec docker compose run --rm dev $0 "$@"
fi
35 changes: 35 additions & 0 deletions scripts/test-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

#
# This script will run compile and run the tests against all the
# stack*.yaml files that are found in the root of the repo, reporting
# whether each one passed or failed.
#
# It is generally useful for doing a final check before pushing, rather
# then as the regular edit/compile/test loop to get feedback during
# development.

. scripts/lib/run-in-container.sh

rm -rf test-all-logs
mkdir test-all-logs

for stack_file in stack-ghc*.yaml; do
log_file="./test-all-logs/$stack_file.log"

echo "Testing with $stack_file... "
if stack --stack-yaml "$stack_file" test >"$log_file" 2>&1; then
echo "Passed"
else
SOME_TEST_FAILED=1
echo "Failed, see $log_file for details"
fi
done

if [ "$SOME_TEST_FAILED" ]; then
echo ""
echo "!!"
echo "!! At least one test failed above. Be sure to check it out!"
echo "!!"
exit 1
fi
6 changes: 6 additions & 0 deletions stack-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages:
- .

flags:
optparse-repl:
strict: true
5 changes: 5 additions & 0 deletions stack-ghc-8.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<<: !include stack-base.yaml
resolver: lts-18.28
extra-deps:
- isocline-1.0.9@sha256:0127f3051694b0c55fad87debdfa590fe4184faebe1e0fe1e552c9bebfba2bc6,2419
- optparse-applicative-0.18.1.0@sha256:f30973861ac7e7ebff05ff8c7c3d1e4d283a1f3850e1cc14106b0693ec1b6d82,5289
26 changes: 26 additions & 0 deletions stack-ghc-8.10.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages:
- completed:
hackage: isocline-1.0.9@sha256:0127f3051694b0c55fad87debdfa590fe4184faebe1e0fe1e552c9bebfba2bc6,2419
pantry-tree:
sha256: 6516783ba24687efeeebb2c32efc9138bb0d8c4d3faa42c69770805cb121959b
size: 2061
original:
hackage: isocline-1.0.9@sha256:0127f3051694b0c55fad87debdfa590fe4184faebe1e0fe1e552c9bebfba2bc6,2419
- completed:
hackage: optparse-applicative-0.18.1.0@sha256:f30973861ac7e7ebff05ff8c7c3d1e4d283a1f3850e1cc14106b0693ec1b6d82,5289
pantry-tree:
sha256: abb295c7aaf194c4cd9ea7201b63e069168ad97cc965e89ec71e09a7c1262de4
size: 3124
original:
hackage: optparse-applicative-0.18.1.0@sha256:f30973861ac7e7ebff05ff8c7c3d1e4d283a1f3850e1cc14106b0693ec1b6d82,5289
snapshots:
- completed:
sha256: 428ec8d5ce932190d3cbe266b9eb3c175cd81e984babf876b64019e2cbe4ea68
size: 590100
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/28.yaml
original: lts-18.28
2 changes: 2 additions & 0 deletions stack-ghc-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<: !include stack-base.yaml
resolver: lts-19.33
12 changes: 12 additions & 0 deletions stack-ghc-9.0.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
size: 619204
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
original: lts-19.33
2 changes: 2 additions & 0 deletions stack-ghc-9.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<: !include stack-base.yaml
resolver: lts-24.8
12 changes: 12 additions & 0 deletions stack-ghc-9.10.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: d347039f81388e16ea93ddaf9ff1850abfba8f8680ff75fbdd177692542ceb26
size: 726286
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/8.yaml
original: lts-24.8
2 changes: 2 additions & 0 deletions stack-ghc-9.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<: !include stack-base.yaml
resolver: lts-20.26
12 changes: 12 additions & 0 deletions stack-ghc-9.2.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2
size: 650475
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/26.yaml
original: lts-20.26
2 changes: 2 additions & 0 deletions stack-ghc-9.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<: !include stack-base.yaml
resolver: lts-21.22
12 changes: 12 additions & 0 deletions stack-ghc-9.4.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- completed:
sha256: afd5ba64ab602cabc2d3942d3d7e7dd6311bc626dcb415b901eaf576cb62f0ea
size: 640060
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/22.yaml
original: lts-21.22
2 changes: 2 additions & 0 deletions stack-ghc-9.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<: !include stack-base.yaml
resolver: lts-22.44
Loading
Loading