Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 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
28 changes: 12 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ on:
pull_request: { branches: [main] }
create: { tags: [v*] }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Comment on lines +8 to +10
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This automatically cancels in progress jobs, making our cancel step below redundant.


defaults:
run:
shell: bash

jobs:
cancel:
name: Cancel redundant actions already in progress
runs-on: ubuntu-latest
steps:
- name: Cancel actions in progress of same workflow and same branch
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

# Check that Haskell code is formatted.
code-formatter:
runs-on: ubuntu-latest
Expand All @@ -31,6 +26,7 @@ jobs:
runs-on: ${{ matrix.os }}
needs: code-formatter
strategy:
fail-fast: false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, failure on one job in the matrix does not cause other jobs to fail.

matrix:
os:
- ubuntu-latest
Expand All @@ -44,14 +40,14 @@ jobs:
# If you change it, make sure to adjust lower bounds there to reflect the change.
# Also, make sure to adjust tested-with field in package.yaml so that it contains
# corresponding GHC version.
stack-resolver: lts-18.21
stack-resolver: lts-19.33

steps:
- name: Checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache (Unix)
uses: actions/cache@v2
uses: actions/cache@v4
if: runner.os == 'Linux' || runner.os == 'macOS'
with:
path: |
Expand All @@ -77,7 +73,7 @@ jobs:
restore-keys: |
haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-
- name: Cache (Windows)
uses: actions/cache@v2
uses: actions/cache@v4
if: runner.os == 'Windows'
with:
# C\:sr is where stack installs compiled dependencies.
Expand Down Expand Up @@ -134,10 +130,10 @@ jobs:
stack path --stack-root
stack ghc -- --version
ghc --version
- name: Build dependencies

- name: Build dependencies
run: stack --install-ghc test --only-dependencies

- name: Build StrongPath & Run tests
run: stack test

Expand Down
8 changes: 4 additions & 4 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ category: System, Filesystem, FilePath

description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to.

tested-with: GHC == 8.10.7, GHC == 9.0.1 # lts-18.21, nightly-2022-01-04
tested-with: GHC == 9.0.2 # lts-19.33

dependencies:
- base >= 4.7 && < 5
Expand All @@ -35,7 +35,7 @@ library:
- path >=0.9.2 && <0.10
- exceptions >=0.10 && <0.11
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Martinsos

If I got it right, the lower bounds should match the version set in workflows/ci.yaml which was 18.21. I am basing this off the comment above that line and your article.

The lower bounds did match that LTS for the most part, but they ignored minor (third digit) changes. For example:

  • The LTS 18.21 version for exceptions is 0.10.4 (source).
  • package.yaml lists >=0.10 as the lower end of the range.

Was this done on purpose as a way to "broaden" the range?

- filepath >=1.4 && <1.5
- template-haskell >=2.16 && <2.18
- template-haskell >=2.17 && <2.18
- hashable >=1.3 && < 1.4

tests:
Expand All @@ -52,7 +52,7 @@ tests:
- filepath
- hashable >=1.3 && < 1.4
- tasty >=1.4 && <1.5
- tasty-hspec >=1.1 && <1.3
- tasty-hspec >=1.2 && <1.3
- tasty-quickcheck >=0.10 && <0.11
- tasty-discover >=4.2 && <4.3
- hspec >=2.7 && <2.10
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did hspec allow for 3 breaking change versions in its range? Is it a case of an "adventurous upper bound?"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check changelog.

- hspec >=2.8 && <2.10
4 changes: 1 addition & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# NOTE: If you modify this field, make sure to update the tested-with
# field in package.yaml to contain the corresponding GHC versions.
resolver: nightly-2022-01-04
resolver: lts-19.33
Copy link
Author

@sodic sodic Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've set both this resolver and the one in workflows/ci.yaml to the same version. If I got it right, this means we're only testing Strong Path against a single version of GHC.

This PR only updates GHC to 9.0.2 and I've mostly done it to get a hang of the procedure, so picking the right LTS versions is not yet important.

Once I actually fully update StrongPath to 9.6.7, which ranges would you like to support and test for? In other words, which LTSs should I list in ci.yaml and stack.yaml?
Perhaps from 9.4.x (2 years ago) to 9.6.7 (current recommended). Or should we go until current latest?


# User packages to be built.
# Various formats can be used as shown in the example below.
Expand All @@ -43,8 +43,6 @@ packages:
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#
extra-deps:
- path-0.9.2

# Override default flag values for local packages and extra-deps
# flags: {}
Expand Down
21 changes: 7 additions & 14 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
@@ -1,19 +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/lock_files
# https://docs.haskellstack.org/en/stable/topics/lock_files

packages: []
snapshots:
- original: nightly-2022-01-04
completed:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/1/4.yaml
sha256: ea584edfba307b5a88b51fc1db7c0c1b7da5f714fd30d69699fc78e3e1ce5212
size: 623654
packages:
- original:
hackage: path-0.9.2
completed:
pantry-tree:
sha256: 2acf94a62daeeb0aee9b77d044ece55b5e03445b574e6980a2e84a5a514f5517
size: 1206
hackage: path-0.9.2@sha256:2f2a7f01737cd350b30381b619e1a862601c83f10ede4d6935f76f66e63ae0c7,3273
- completed:
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
size: 619204
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
original: lts-19.33
8 changes: 4 additions & 4 deletions strong-path.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

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

Expand Down Expand Up @@ -48,7 +48,7 @@ library
, filepath ==1.4.*
, hashable ==1.3.*
, path >=0.9.2 && <0.10
, template-haskell >=2.16 && <2.18
, template-haskell ==2.17.*
default-language: Haskell2010

test-suite strong-path-test
Expand All @@ -71,11 +71,11 @@ test-suite strong-path-test
base >=4.7 && <5
, filepath
, hashable ==1.3.*
, hspec >=2.7 && <2.10
, hspec >=2.8 && <2.10
, path
, strong-path
, tasty ==1.4.*
, tasty-discover ==4.2.*
, tasty-hspec >=1.1 && <1.3
, tasty-hspec ==1.2.*
, tasty-quickcheck ==0.10.*
default-language: Haskell2010
Loading