Skip to content

Commit

Permalink
Merge branch 'main' into ci-stack
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed May 21, 2024
2 parents a640662 + 49dd258 commit b2cf0e9
Show file tree
Hide file tree
Showing 70 changed files with 16,656 additions and 215 deletions.
72 changes: 50 additions & 22 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,72 @@ name: cabal

on:
push:
branches: [ci-cabal]
branches: [main, ci-cabal]
pull_request:
branches: [main]

jobs:
build:
name: ghc ${{ matrix.ghc }}
name: ghc-${{ matrix.vers.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.6"]
ghc:
- "8.8.4"
- "8.10.7"
- "9.0.1"
cabal: ["3.10.3.0"]
vers:
- {ghc: "9.2.8", stackage: "lts-20.26"}
- {ghc: "9.4.8", stackage: "lts-21.25"}
- {ghc: "9.6.5", stackage: "lts-22.22"}
- {ghc: "9.8.2", stackage: "nightly-2024-05-18"}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v1
name: setup GHC and cabal-install
- name: Set up GHC and cabal-install
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
ghc-version: ${{ matrix.vers.ghc }}
cabal-version: ${{ matrix.cabal }}
enable-stack: true
stack-version: '2.15.7'

- uses: actions/cache@v2
name: cache ~/.cabal/store
- name: Update hackage index
run: cabal update --ignore-project

- name: Install Dhall
uses: dhall-lang/setup-dhall@v4
with:
version: '1.42.0'

- name: Updo
run: GHC_VERSION=${{ matrix.vers.ghc }} STACKAGE_VERSION=${{ matrix.vers.stackage }} make -f project-files.mk cabal.project

- name: Build dry run
run: cabal build all --enable-tests --enable-benchmarks --dry-run

- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-cabal
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies

- name: Save cached dependencies
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: build
run: |
cabal v2-update
cabal v2-build all --enable-tests
run: cabal build all --enable-tests --enable-benchmarks

- name: test golden
run: cabal v2-test test:golden --test-show-details=direct --test-option="--color=always"

- name: test hlint
run: cabal v2-test test:hlint --test-show-details=direct --test-option="--color=always"
run: cabal test test:golden --test-show-details=direct --test-option="--color=always"
30 changes: 30 additions & 0 deletions .github/workflows/hlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: hlint

on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"

jobs:
build:
name: hlint-3.8
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: haskell-actions/hlint-setup@v2
name: Set up HLint
with:
version: "3.8"

- uses: haskell-actions/hlint-run@v2
name: hlint
with:
path: '["library/", "exe/", "test-suite-golden/src"]'
fail-on: suggestion
22 changes: 12 additions & 10 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: stack

on:
push:
branches: [ci-stack]
branches: [main, ci-stack]
pull_request:
branches: [main]

Expand All @@ -11,12 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.6"]
ghc:
- "9.0.1"
cabal: ["3.10"]
vers:
- {ghc: "9.2.8", stackage: "lts-20.26"}
- {ghc: "9.4.8", stackage: "lts-21.25"}
- {ghc: "9.6.5", stackage: "lts-22.22"}
- {ghc: "9.8.2", stackage: "nightly-2024-05-18"}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v1
name: setup stack
Expand All @@ -29,13 +32,12 @@ jobs:
name: cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-cabal
key: ${{ runner.os }}-${{ matrix.vers.ghc }}-stack

- name: build tests
run: stack test --no-run-tests --no-terminal --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml
run: |
GHC_VERSION=${{ matrix.vers.ghc }} STACKAGE_VERSION=${{ matrix.vers.stackage }} make -f project-files.mk
stack test --no-run-tests --no-terminal
- name: test golden
run: stack test hpack-dhall:golden --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml

- name: test hlint
run: stack test hpack-dhall:hlint --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml
13 changes: 13 additions & 0 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: whitespace

on:
push:
pull_request:

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: andreasabel/fix-whitespace-action@v1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.ghc.environment.*
.stack-work*
__bin
.updo
updo
project-nix
project-versions.nix
Empty file added .hlint.yaml
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ it should be possible to get them in sync again.
![cabal](https://github.com/BlockScope/hpack-dhall/workflows/cabal/badge.svg)
![stack](https://github.com/BlockScope/hpack-dhall/workflows/stack/badge.svg)
[![hackage release](https://img.shields.io/hackage/v/hpack-dhall.svg?label=hackage)](http://hackage.haskell.org/package/hpack-dhall)
[![Dependencies of latest version on Hackage](https://img.shields.io/hackage-deps/v/hpack-dhall.svg)](https://hackage.haskell.org/package/hpack-dhall)
[![Dependencies of latest version on Hackage](https://img.shields.io/hackage-deps/v/hpack-dhall.svg)](https://hackage.haskell.org/package/hpack-dhall)
19 changes: 18 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
packages: hpack-dhall.cabal
import: ./project-stackage/lts-21.25.config

packages:
.

constraints:
crypton ==1.0.0
, crypton-connection ==0.4.0
, crypton-x509 ==1.7.6
, crypton-x509-store ==1.6.9
, crypton-x509-system ==1.6.7
, crypton-x509-validation ==1.6.12
, hpack ==0.36.0
, http-client-tls ==0.3.6.3
, tls ==2.0.5

program-options
ghc-options: -fhide-source-paths
14 changes: 12 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
The [latest version](https://github.com/blockscope/hpack-dhall/blob/master/changelog.md) of this changelog.

## 0.5.4 - Rewrite the README
## 0.5.7 - Bump hpack and test versions
* Require `hpack ^>= 0.35` and pin extra-deps for stack build and tests.

## 0.5.6 - Relax hpack version upper bound
* Relax hpack bounds to `hpack >= 0.34.7` for stackage build.

## 0.5.5 - Bump hpack and test versions
* Require `hpack ^>= 0.34.7`.
* Test with GHC `8.8.4`, GHC `8.10.7`, GHC `9.0.2` and GHC `9.2.2`.

## 0.5.4 - Bump hpack and test versions
* Require `hpack >= 0.34.6`.
* Test with GHC `8.8.4`, GHC `8.10.7` and GHC `9.0.1`.

Expand Down Expand Up @@ -37,7 +47,7 @@ The [latest version](https://github.com/blockscope/hpack-dhall/blob/master/chang
* Use explicit dependencies to achieve consistent golden tests in all but
stack-8.6.3.yaml.

## 0.5.1 - Minor, bump in hpack version
## 0.5.1 - Minor, bump in hpack version
* Regenerate golden files for the bump in hpack's version:

```
Expand Down
11 changes: 0 additions & 11 deletions default-tests.dhall

This file was deleted.

48 changes: 48 additions & 0 deletions dhall/ghc-2021.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[ "ImplicitPrelude"
, "StarIsType"
, "MonomorphismRestriction"
, "TraditionalRecordSyntax"
, "EmptyDataDecls"
, "ForeignFunctionInterface"
, "PatternGuards"
, "DoAndIfThenElse"
, "FieldSelectors"
, "RelaxedPolyRec"
, "BangPatterns"
, "BinaryLiterals"
, "ConstrainedClassMethods"
, "ConstraintKinds"
, "DeriveDataTypeable"
, "DeriveFoldable"
, "DeriveFunctor"
, "DeriveGeneric"
, "DeriveLift"
, "DeriveTraversable"
, "EmptyCase"
, "EmptyDataDeriving"
, "ExistentialQuantification"
, "ExplicitForAll"
, "FlexibleContexts"
, "FlexibleInstances"
, "GADTSyntax"
, "GeneralizedNewtypeDeriving"
, "HexFloatLiterals"
, "ImportQualifiedPost"
, "InstanceSigs"
, "KindSignatures"
, "MultiParamTypeClasses"
, "RecordPuns"
, "NamedWildCards"
, "NumericUnderscores"
, "PolyKinds"
, "PostfixOperators"
, "RankNTypes"
, "ScopedTypeVariables"
, "StandaloneDeriving"
, "StandaloneKindSignatures"
, "TupleSections"
, "TypeApplications"
, "TypeOperators"
, "TypeSynonymInstances"
]
: List Text
4 changes: 2 additions & 2 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Copied executables to /Users/pdejoux/.local/bin:
- dhall-hpack-cabal
- dhall-hpack-dhall
- dhall-hpack-json
- dhall-hpack-yaml
- dhall-hpack-yaml
# installing with cabal
$ ghcup --version
Expand All @@ -28,4 +28,4 @@ Symlinking 'dhall-hpack-dhall' to '/Users/.../.cabal/bin/dhall-hpack-dhall'
Symlinking 'dhall-hpack-json' to '/Users/.../.cabal/bin/dhall-hpack-json'
Symlinking 'dhall-hpack-yaml' to '/Users/.../.cabal/bin/dhall-hpack-yaml'
Symlinking 'dhall-hpack-cabal' to '/Users/.../.cabal/bin/dhall-hpack-cabal'
```
```
13 changes: 13 additions & 0 deletions fix-whitespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
excluded-dirs:
- "dist-newstyle"
- ".updo"
- "updo"

included-files:
- "**/*.cabal"
- "**/*.dhall"
- "**/*.hs"
- "**/*.md"
- "**/*.project"
- "**/*.yaml"
- "**/*.yml"
Loading

0 comments on commit b2cf0e9

Please sign in to comment.