Skip to content

Commit

Permalink
Many updates
Browse files Browse the repository at this point in the history
* git-ignore stack.yaml.lock files

These lock files help with reproducibility and can alert developers if
the exact code behind a given resolver or extra-dep has changed since
the last build. However, certain tooling does or does not keep them
updated and this fact has led to confusion that is not worth this
benefit, particularly in projects with a lot of separate resolver files.
Therefore, we're going to start phasing out keeping them committed.

* Rename stack-lts files to only specify major

That's all that matters, and we don't want filenames (and test matrix
names) to change if minor versions fluctuate.

As part of this we move, to a hyphen-less suffix since that's what some
tooling (stack-all) expects, and it doesn't negatively affect anything
else.

* Use new haskell-actions organization

* Configure actions-based Restyled

* Add .stack-all configuration

* Add stack configurations for lts 21 through 23

* Make stack.yaml a symlink to stack-lts23.yaml

* Update release workflow

- `haskell-tag-action` doesn't need an explicit token
- `stack-upload-action` is deprecated, just use `stack upload`

* Add typically-disabled 9.8 warnings

* Add lts20-like extra-deps to lts21

* Update extra-deps in lts21

* Remove unnecessary pragma

Newer hspec-discover seems to include an export list.

* Move from library,tests to src,test

Anecdotally, `app,src,test` is more common that
`executables,library,tests`. It's also what `stack new` creates (`cabal
init` creates no directories). No one on the team expressed a strong
objection[^1], so we'll start a soft migration (i.e. use it in new
stuff, change at our leisure).

[^1]: https://freckleinc.slack.com/archives/C459XJBGR/p1702402421106759
  • Loading branch information
pbrisbin authored Jan 10, 2025
1 parent 3515933 commit 6d9ea59
Show file tree
Hide file tree
Showing 28 changed files with 54 additions and 452 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/hlint-setup@v2
- uses: haskell/actions/hlint-run@v2
- uses: haskell-actions/hlint-setup@v2
- uses: haskell-actions/hlint-run@v2
with:
fail-on: warning
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:

- id: tag
uses: freckle/haskell-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: steps.tag.outputs.tag
uses: freckle/stack-upload-action@v2
run: stack upload --pvp-bounds lower .
env:
HACKAGE_API_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }}
HACKAGE_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }}
STACK_YAML: stack-lts12.yaml
18 changes: 18 additions & 0 deletions .github/workflows/restyled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Restyled

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
restyled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: restyled-io/actions/setup@v4
- uses: restyled-io/actions/run@v4
with:
suggestions: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.stack-work
*.hie
.hiedb
.stack-work
stack*.yaml.lock
2 changes: 2 additions & 0 deletions .stack-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[versions]
oldest = lts-12
12 changes: 9 additions & 3 deletions haskell-library-template.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.18

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -33,7 +33,7 @@ library
other-modules:
Paths_haskell_library_template
hs-source-dirs:
library
src
default-extensions:
BangPatterns
DataKinds
Expand Down Expand Up @@ -63,6 +63,8 @@ library
build-depends:
base <5
default-language: Haskell2010
if impl(ghc >= 9.8)
ghc-options: -Wno-missing-role-annotations -Wno-missing-poly-kind-signatures
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
if impl(ghc >= 8.10)
Expand Down Expand Up @@ -105,6 +107,8 @@ test-suite readme
base <5
, markdown-unlit
default-language: Haskell2010
if impl(ghc >= 9.8)
ghc-options: -Wno-missing-role-annotations -Wno-missing-poly-kind-signatures
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
if impl(ghc >= 8.10)
Expand All @@ -120,7 +124,7 @@ test-suite spec
WhateverSpec
Paths_haskell_library_template
hs-source-dirs:
tests
test
default-extensions:
BangPatterns
DataKinds
Expand Down Expand Up @@ -152,6 +156,8 @@ test-suite spec
, hspec
, hspec-junit-formatter
default-language: Haskell2010
if impl(ghc >= 9.8)
ghc-options: -Wno-missing-role-annotations -Wno-missing-poly-kind-signatures
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
if impl(ghc >= 8.10)
Expand Down
8 changes: 6 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ghc-options:
- -Wno-unsafe

when:
- condition: "impl(ghc >= 9.8)"
ghc-options:
- -Wno-missing-role-annotations
- -Wno-missing-poly-kind-signatures
- condition: "impl(ghc >= 9.2)"
ghc-options:
- -Wno-missing-kind-signatures
Expand Down Expand Up @@ -71,12 +75,12 @@ default-extensions:
- TypeFamilies

library:
source-dirs: library
source-dirs: src

tests:
spec:
main: Spec.hs
source-dirs: tests
source-dirs: test
ghc-options: -threaded -rtsopts "-with-rtsopts=-N"
dependencies:
#- haskell-library-template
Expand Down
96 changes: 0 additions & 96 deletions stack-lts-12.26.yaml.lock

This file was deleted.

75 changes: 0 additions & 75 deletions stack-lts-14.27.yaml.lock

This file was deleted.

68 changes: 0 additions & 68 deletions stack-lts-16.31.yaml.lock

This file was deleted.

Loading

0 comments on commit 6d9ea59

Please sign in to comment.