From 9fe062edccd7aa20d510f24ea2409e17522b52f3 Mon Sep 17 00:00:00 2001 From: Paul Burns Date: Tue, 18 Aug 2026 19:02:39 -0400 Subject: [PATCH 1/4] Convert packages to hpack, correct stale dependency bounds Every flipstone repo running the multi-GHC matrix workflow defines its packages in package.yaml, so move all three here to match. The generated .cabal files are committed alongside, as they are elsewhere. Metadata and bounds carry over unchanged apart from the corrections below. Three bounds were wrong, and building against six GHC versions is what surfaced them: resourcet >= 1.2 && < 1.3 excluded resourcet-1.3.0, which is what lts-24 carries, so ftp-client-conduit could not build there at all. The module uses resourcet only for the MonadResource class, which is unchanged across that boundary, so the bound moves to < 1.4. ftp-client-conduit asked for crypton-connection >= 0.4 while ftp-client accepted >= 0.3. The conduit code uses exactly one symbol from the package, connectionClose, which 0.3 has. Relaxing it to match ftp-client lets both build on lts-22, whose crypton-connection is 0.3.2. base >= 4.8 (ftp-client) and base >= 4.7 (ftp-client-conduit) claimed support back to GHC 7.10. Nothing that old can build these packages, because crypton-connection did not exist then. Both become >= 4.16, the oldest GHC now actually tested, and tested-with records the rest. --- example/example.cabal | 77 +++++++++------- example/package.yaml | 40 +++++++++ ftp-client-conduit/ftp-client-conduit.cabal | 92 ++++++++++++------- ftp-client-conduit/package.yaml | 53 +++++++++++ ftp-client/ftp-client.cabal | 99 +++++++++++++-------- ftp-client/package.yaml | 56 ++++++++++++ 6 files changed, 312 insertions(+), 105 deletions(-) create mode 100644 example/package.yaml create mode 100644 ftp-client-conduit/package.yaml create mode 100644 ftp-client/package.yaml diff --git a/example/example.cabal b/example/example.cabal index 3074827..809ad46 100644 --- a/example/example.cabal +++ b/example/example.cabal @@ -1,37 +1,48 @@ -name: example -version: 0.1.0.0 --- synopsis: --- description: -homepage: https://github.com/githubuser/example#readme -license: BSD3 -license-file: LICENSE -author: Author name here -maintainer: example@example.com -copyright: 2017 Author name here -category: Web -build-type: Simple -cabal-version: >=1.10 +cabal-version: 1.12 -executable example-exe - hs-source-dirs: app - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: base - , ftp-client - , ftp-client-conduit - , conduit - , bytestring - , containers - default-language: Haskell2010 +-- This file has been generated from package.yaml by hpack version 0.39.1. +-- +-- see: https://github.com/sol/hpack -test-suite example-test - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Spec.hs - build-depends: base - ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 +name: example +version: 0.1.0.0 +category: Web +homepage: https://github.com/flipstone/ftp-client +author: Author name here +maintainer: example@example.com +copyright: 2017 Author name here +license: BSD3 +license-file: LICENSE +build-type: Simple source-repository head - type: git - location: https://github.com/githubuser/example + type: git + location: https://github.com/flipstone/ftp-client + +executable example-exe + main-is: Main.hs + other-modules: + Paths_example + hs-source-dirs: + app + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + base + , bytestring + , conduit + , containers + , ftp-client + , ftp-client-conduit + default-language: Haskell2010 + +test-suite example-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Paths_example + hs-source-dirs: + test + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + base + default-language: Haskell2010 diff --git a/example/package.yaml b/example/package.yaml new file mode 100644 index 0000000..4bdc1b1 --- /dev/null +++ b/example/package.yaml @@ -0,0 +1,40 @@ +name: example +version: 0.1.0.0 +homepage: https://github.com/flipstone/ftp-client +license: BSD3 +license-file: LICENSE +author: Author name here +maintainer: example@example.com +copyright: 2017 Author name here +category: Web + +git: https://github.com/flipstone/ftp-client + +executables: + example-exe: + main: Main.hs + source-dirs: app + language: Haskell2010 + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - base + - ftp-client + - ftp-client-conduit + - conduit + - bytestring + - containers + +tests: + example-test: + main: Spec.hs + source-dirs: test + language: Haskell2010 + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - base diff --git a/ftp-client-conduit/ftp-client-conduit.cabal b/ftp-client-conduit/ftp-client-conduit.cabal index 5d43475..a439f8a 100644 --- a/ftp-client-conduit/ftp-client-conduit.cabal +++ b/ftp-client-conduit/ftp-client-conduit.cabal @@ -1,39 +1,63 @@ -name: ftp-client-conduit -version: 0.5.0.5 -synopsis: Transfer file with FTP and FTPS with Conduit -description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. ftp-client-conduit uses conduit to stream files and data in constant space. -homepage: https://github.com/flipstone/ftp-client -maintainer: Flipstone Technology Partners -license: PublicDomain -license-file: LICENSE -author: Megan Robinson -category: Web -build-type: Simple -extra-source-files: README.md -cabal-version: >=1.10 +cabal-version: 1.12 -library - hs-source-dirs: src - exposed-modules: Network.FTP.Client.Conduit - build-depends: base >= 4.7 && < 5 - , ftp-client == 0.5.* - , conduit >= 1.1 - , bytestring - , resourcet >= 1.2 && < 1.3 - , crypton-connection >= 0.4 && < 0.5 - , exceptions - default-language: Haskell2010 - default-extensions: RankNTypes, OverloadedStrings +-- This file has been generated from package.yaml by hpack version 0.39.1. +-- +-- see: https://github.com/sol/hpack -test-suite ftp-conduit-test - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Spec.hs - build-depends: base >=4.11.1.0 && < 5 - , ftp-client-conduit - ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 +name: ftp-client-conduit +version: 0.5.0.5 +synopsis: Transfer file with FTP and FTPS with Conduit +description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. ftp-client-conduit uses conduit to stream files and data in constant space. +category: Web +homepage: https://github.com/flipstone/ftp-client +author: Megan Robinson +maintainer: Flipstone Technology Partners +license: PublicDomain +license-file: LICENSE +build-type: Simple +tested-with: + GHC == 9.2.8 + , GHC == 9.4.8 + , GHC == 9.6.7 + , GHC == 9.8.4 + , GHC == 9.10.3 + , GHC == 9.12.4 +extra-source-files: + README.md source-repository head - type: git + type: git location: https://github.com/flipstone/ftp-client + +library + exposed-modules: + Network.FTP.Client.Conduit + other-modules: + Paths_ftp_client_conduit + hs-source-dirs: + src + default-extensions: + RankNTypes + OverloadedStrings + build-depends: + base >=4.16 && <5 + , bytestring + , conduit >=1.1 + , crypton-connection >=0.3 && <0.5 + , exceptions + , ftp-client ==0.5.* + , resourcet >=1.2 && <1.4 + default-language: Haskell2010 + +test-suite ftp-conduit-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Paths_ftp_client_conduit + hs-source-dirs: + test + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + base >=4.16 && <5 + , ftp-client-conduit + default-language: Haskell2010 diff --git a/ftp-client-conduit/package.yaml b/ftp-client-conduit/package.yaml new file mode 100644 index 0000000..c2877dd --- /dev/null +++ b/ftp-client-conduit/package.yaml @@ -0,0 +1,53 @@ +name: ftp-client-conduit +version: 0.5.0.5 +synopsis: Transfer file with FTP and FTPS with Conduit +description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. ftp-client-conduit uses conduit to stream files and data in constant space. +homepage: https://github.com/flipstone/ftp-client +license: PublicDomain +license-file: LICENSE +author: Megan Robinson +maintainer: Flipstone Technology Partners +category: Web + +tested-with: + - GHC == 9.2.8 + - GHC == 9.4.8 + - GHC == 9.6.7 + - GHC == 9.8.4 + - GHC == 9.10.3 + - GHC == 9.12.4 + +extra-source-files: + - README.md + +git: https://github.com/flipstone/ftp-client + +library: + source-dirs: src + exposed-modules: + - Network.FTP.Client.Conduit + language: Haskell2010 + default-extensions: + - RankNTypes + - OverloadedStrings + dependencies: + - base >= 4.16 && < 5 + - ftp-client == 0.5.* + - conduit >= 1.1 + - bytestring + - resourcet >= 1.2 && < 1.4 + - crypton-connection >= 0.3 && < 0.5 + - exceptions + +tests: + ftp-conduit-test: + main: Spec.hs + source-dirs: test + language: Haskell2010 + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - base >= 4.16 && < 5 + - ftp-client-conduit diff --git a/ftp-client/ftp-client.cabal b/ftp-client/ftp-client.cabal index 7dd1757..2690807 100644 --- a/ftp-client/ftp-client.cabal +++ b/ftp-client/ftp-client.cabal @@ -1,43 +1,66 @@ -name: ftp-client -version: 0.5.1.6 -synopsis: Transfer files with FTP and FTPS -description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. -homepage: https://github.com/flipstone/ftp-client -license: PublicDomain -maintainer: Flipstone Technology Partners -license-file: LICENSE -author: Megan Robinson -category: Web -build-type: Simple -extra-source-files: README.md -cabal-version: >=1.10 +cabal-version: 1.12 -library - hs-source-dirs: src - exposed-modules: Network.FTP.Client - default-language: Haskell2010 - default-extensions: OverloadedStrings - build-depends: base >= 4.8 && < 5 - , bytestring >= 0.10.8.2 && < 0.13 - , network >= 2.6.3.6 && < 3.3 - , attoparsec >= 0.10 && < 0.15 - , crypton-connection >= 0.3 && < 0.5 - , transformers >= 0.5.6.2 && < 0.7 - , exceptions >= 0.10.3 && < 0.11 - , containers >= 0.5.11.0 && < 0.8 - , data-default-class >= 0.1.2.0 && < 0.3 +-- This file has been generated from package.yaml by hpack version 0.39.1. +-- +-- see: https://github.com/sol/hpack -test-suite ftp-client-test - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: test.hs - build-depends: base >=4.11.1.0 && < 5 - , bytestring >=0.10.8.2 && <0.13 - , hspec >= 2.7 - , ftp-client -any - ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 +name: ftp-client +version: 0.5.1.6 +synopsis: Transfer files with FTP and FTPS +description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. +category: Web +homepage: https://github.com/flipstone/ftp-client +author: Megan Robinson +maintainer: Flipstone Technology Partners +license: PublicDomain +license-file: LICENSE +build-type: Simple +tested-with: + GHC == 9.2.8 + , GHC == 9.4.8 + , GHC == 9.6.7 + , GHC == 9.8.4 + , GHC == 9.10.3 + , GHC == 9.12.4 +extra-source-files: + README.md source-repository head - type: git + type: git location: https://github.com/flipstone/ftp-client + +library + exposed-modules: + Network.FTP.Client + other-modules: + Paths_ftp_client + hs-source-dirs: + src + default-extensions: + OverloadedStrings + build-depends: + attoparsec >=0.10 && <0.15 + , base >=4.16 && <5 + , bytestring >=0.10.8.2 && <0.13 + , containers >=0.5.11.0 && <0.8 + , crypton-connection >=0.3 && <0.5 + , data-default-class >=0.1.2.0 && <0.3 + , exceptions >=0.10.3 && <0.11 + , network >=2.6.3.6 && <3.3 + , transformers >=0.5.6.2 && <0.7 + default-language: Haskell2010 + +test-suite ftp-client-test + type: exitcode-stdio-1.0 + main-is: test.hs + other-modules: + Paths_ftp_client + hs-source-dirs: + test + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + base >=4.16 && <5 + , bytestring >=0.10.8.2 && <0.13 + , ftp-client + , hspec >=2.7 + default-language: Haskell2010 diff --git a/ftp-client/package.yaml b/ftp-client/package.yaml new file mode 100644 index 0000000..4565f68 --- /dev/null +++ b/ftp-client/package.yaml @@ -0,0 +1,56 @@ +name: ftp-client +version: 0.5.1.6 +synopsis: Transfer files with FTP and FTPS +description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. +homepage: https://github.com/flipstone/ftp-client +license: PublicDomain +license-file: LICENSE +author: Megan Robinson +maintainer: Flipstone Technology Partners +category: Web + +tested-with: + - GHC == 9.2.8 + - GHC == 9.4.8 + - GHC == 9.6.7 + - GHC == 9.8.4 + - GHC == 9.10.3 + - GHC == 9.12.4 + +extra-source-files: + - README.md + +git: https://github.com/flipstone/ftp-client + +library: + source-dirs: src + exposed-modules: + - Network.FTP.Client + language: Haskell2010 + default-extensions: + - OverloadedStrings + dependencies: + - base >= 4.16 && < 5 + - bytestring >= 0.10.8.2 && < 0.13 + - network >= 2.6.3.6 && < 3.3 + - attoparsec >= 0.10 && < 0.15 + - crypton-connection >= 0.3 && < 0.5 + - transformers >= 0.5.6.2 && < 0.7 + - exceptions >= 0.10.3 && < 0.11 + - containers >= 0.5.11.0 && < 0.8 + - data-default-class >= 0.1.2.0 && < 0.3 + +tests: + ftp-client-test: + main: test.hs + source-dirs: test + language: Haskell2010 + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - base >= 4.16 && < 5 + - bytestring >= 0.10.8.2 && < 0.13 + - hspec >= 2.7 + - ftp-client From 2801b140be6c9f7af1c7578e6445a0bae4de60b3 Mon Sep 17 00:00:00 2001 From: Paul Burns Date: Tue, 18 Aug 2026 19:02:52 -0400 Subject: [PATCH 2/4] Add dockerized CI testing against GHC 9.2 through 9.12 This repo had no CI, and stack could not build it at all: stack.yaml pinned lts-16.9 (GHC 8.8.3), which cannot satisfy the crypton-connection dependency the package has claimed since 1cbd6b9. The hspec suite was reachable only by running cabal by hand, which is why it went unnoticed during review of #2. Adopts the same shape as the rest of the org: a dev container on the haskell-tools image, scripts that re-exec themselves into it, one stack-ghc-*.yaml per GHC, and a workflow whose matrix is discovered by globbing those files. scripts/test-all uses the same glob, so local and CI coverage cannot drift. ftp-client is the only repo here depending on crypton-connection, so the old resolvers need help. lts-21 has no crypton-connection and lts-20 has no crypton at all, so both pin the versions that shipped together in lts-22. The newer crypton-x509 1.9 series is deliberately avoided: it wants crypton 1.1 and the crypton-asn1-* rewrite, which would mean replacing most of the snapshot's crypto stack. No fourmolu and no formatting job, following haskell-non-empty-text -- this code has never been formatted and reformatting it would rewrite every line. No strict ghc-options flag yet either; -Wall currently reports 27 warnings in ftp-client and 22 across the other two, which is a separate cleanup. Lock files are committed and scripts/test enforces them in CI with --lock-file error-on-write, so stack.yaml.lock comes out of .gitignore. --- .github/workflows/main.yaml | 107 ++++++++++++++++++++++++++++++++ .gitignore | 7 ++- compose.yaml | 18 ++++++ scripts/bootstrap | 16 +++++ scripts/build | 5 ++ scripts/cabal-latest | 10 +++ scripts/lib/run-in-container.sh | 9 +++ scripts/shell | 7 +++ scripts/shellcheck | 13 ++++ scripts/test | 11 ++++ scripts/test-all | 35 +++++++++++ stack-base.yaml | 6 ++ stack-ghc-9.10.yaml | 4 ++ stack-ghc-9.10.yaml.lock | 12 ++++ stack-ghc-9.12.yaml | 4 ++ stack-ghc-9.12.yaml.lock | 12 ++++ stack-ghc-9.2.yaml | 15 +++++ stack-ghc-9.2.yaml.lock | 61 ++++++++++++++++++ stack-ghc-9.4.yaml | 16 +++++ stack-ghc-9.4.yaml.lock | 54 ++++++++++++++++ stack-ghc-9.6.yaml | 4 ++ stack-ghc-9.6.yaml.lock | 12 ++++ stack-ghc-9.8.yaml | 4 ++ stack-ghc-9.8.yaml.lock | 12 ++++ stack.yaml | 8 +-- stack.yaml.lock | 12 ++++ 26 files changed, 465 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/main.yaml create mode 100644 compose.yaml create mode 100755 scripts/bootstrap create mode 100755 scripts/build create mode 100755 scripts/cabal-latest create mode 100644 scripts/lib/run-in-container.sh create mode 100755 scripts/shell create mode 100755 scripts/shellcheck create mode 100755 scripts/test create mode 100755 scripts/test-all create mode 100644 stack-base.yaml create mode 100644 stack-ghc-9.10.yaml create mode 100644 stack-ghc-9.10.yaml.lock create mode 100644 stack-ghc-9.12.yaml create mode 100644 stack-ghc-9.12.yaml.lock create mode 100644 stack-ghc-9.2.yaml create mode 100644 stack-ghc-9.2.yaml.lock create mode 100644 stack-ghc-9.4.yaml create mode 100644 stack-ghc-9.4.yaml.lock create mode 100644 stack-ghc-9.6.yaml create mode 100644 stack-ghc-9.6.yaml.lock create mode 100644 stack-ghc-9.8.yaml create mode 100644 stack-ghc-9.8.yaml.lock create mode 100644 stack.yaml.lock diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..9d9d73a --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,107 @@ +name: Build and Test + +on: + push: + +defaults: + run: + shell: bash + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: ${{ github.ref_name != 'main' }} + +jobs: + find-stack-yamls: + name: Find stack.yamls for GHC Matrix + runs-on: ubuntu-24.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@2c1f2781f8a1b92a0ad82223adf77bbf24b262c2 + + build: + name: Build and Test + needs: find-stack-yamls + runs-on: ubuntu-24.04 + strategy: + max-parallel: 5 + matrix: + stack-yaml: ${{ fromJson(needs.find-stack-yamls.outputs.stack-yamls) }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Cache + uses: actions/cache@v5 + env: + cache-version: v1 + 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@2c1f2781f8a1b92a0ad82223adf77bbf24b262c2 + with: + stack-root: ./stack-root + + - name: Build and test + run: ./scripts/test --stack-yaml ${{ matrix.stack-yaml }} + + cabal-check: + name: Cabal Check + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Stack (for docker env) + uses: flipstone/github-actions/setup-dockerized-stack@2c1f2781f8a1b92a0ad82223adf77bbf24b262c2 + with: + stack-root: ./stack-root + + # Only the two published packages are checked. The example package is not + # released to Hackage. + - name: Check for Hackage releasable issues + run: docker compose run --rm dev sh -c 'set -o errexit; cd ftp-client; cabal check; cd ../ftp-client-conduit; cabal check' + + shellcheck: + name: shellcheck + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Stack (for docker env) + uses: flipstone/github-actions/setup-dockerized-stack@2c1f2781f8a1b92a0ad82223adf77bbf24b262c2 + with: + stack-root: ./stack-root + + - name: Shellcheck + run: scripts/shellcheck + + cabal-latest-build: + name: Cabal Build + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Stack (for docker env) + uses: flipstone/github-actions/setup-dockerized-stack@2c1f2781f8a1b92a0ad82223adf77bbf24b262c2 + 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 diff --git a/.gitignore b/.gitignore index 5bde923..8983f94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -.stack-work +.stack-work/ +dist-newstyle/ +.env +test-all-logs/ *.prof -stack.yaml.lock +*~ diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..0e23742 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,18 @@ +services: + dev: + image: ghcr.io/flipstone/haskell-tools:debian-ghc-9.10.3-6a98b0f + volumes: + - .:${PROJECT_DIR} + - flipstone_stack_root:/stack-root + working_dir: ${PROJECT_DIR} + tty: true + environment: + STACK_ROOT: /stack-root + IN_DEV_CONTAINER: 'true' + # Pass through the CI variable from GitHub (or set it to `true` locally + # for debugging CI builds) + CI: + +volumes: + flipstone_stack_root: + external: true diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..c9df255 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,16 @@ +#!/bin/sh + +set -o errexit + +if docker volume inspect flipstone_stack_root >/dev/null 2>/dev/null; then + echo "Skipping creation of flipstone_stack_root docker volume. It already exists" +else + echo "Creating flipstone_stack_root docker volume" + docker volume create flipstone_stack_root +fi + +if [ -f .env ]; then + echo "Skipping creation of .env because it already exists. Remove it if you want this script to recreate it" +else + echo "PROJECT_DIR=$PWD" >> .env +fi diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..c7d5ebe --- /dev/null +++ b/scripts/build @@ -0,0 +1,5 @@ +#!/bin/sh + +set -o errexit + +./scripts/test-all diff --git a/scripts/cabal-latest b/scripts/cabal-latest new file mode 100755 index 0000000..4754c61 --- /dev/null +++ b/scripts/cabal-latest @@ -0,0 +1,10 @@ +#!/bin/sh + +set -o errexit + +. scripts/lib/run-in-container.sh + +ghcup install ghc latest --set + +cabal update +cabal build diff --git a/scripts/lib/run-in-container.sh b/scripts/lib/run-in-container.sh new file mode 100644 index 0000000..8e17cd2 --- /dev/null +++ b/scripts/lib/run-in-container.sh @@ -0,0 +1,9 @@ +if [ "$IN_DEV_CONTAINER" ]; then + # Already in container, nothing to do + : +else + # Script was run from outside the container, re-exec inside the container + # with the same arguments + docker compose build + exec docker compose run --rm dev $0 "$@" +fi diff --git a/scripts/shell b/scripts/shell new file mode 100755 index 0000000..b313c41 --- /dev/null +++ b/scripts/shell @@ -0,0 +1,7 @@ +#!/bin/sh + +set -o errexit + +. scripts/lib/run-in-container.sh + +exec bash "$@" diff --git a/scripts/shellcheck b/scripts/shellcheck new file mode 100755 index 0000000..6b0fd3b --- /dev/null +++ b/scripts/shellcheck @@ -0,0 +1,13 @@ +#!/bin/sh + +set -o errexit +set -o xtrace + +. scripts/lib/run-in-container.sh + +apt update +apt install --yes file + +# We want to ignore things in a handful of directories related to stack, cabal and git, but +# otherwise find shell scripts and run shellcheck against them. +find . -type f -exec file {} + | grep -v -e '.stack-work' -e 'stack-root' -e 'dist-newstyle' -e '.git' | awk -F: '/shell script/{print $1}' | xargs stack exec shellcheck -- -x diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..313421e --- /dev/null +++ b/scripts/test @@ -0,0 +1,11 @@ +#!/bin/sh + +set -o errexit + +. scripts/lib/run-in-container.sh + +if [ "$CI" ]; then + stack --lock-file error-on-write test "$@" +else + stack test --fast "$@" +fi diff --git a/scripts/test-all b/scripts/test-all new file mode 100755 index 0000000..c8771bb --- /dev/null +++ b/scripts/test-all @@ -0,0 +1,35 @@ +#!/bin/sh + +# +# This script will 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 +# than 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 diff --git a/stack-base.yaml b/stack-base.yaml new file mode 100644 index 0000000..b7fa0aa --- /dev/null +++ b/stack-base.yaml @@ -0,0 +1,6 @@ +packages: + - 'ftp-client' + - 'ftp-client-conduit' + - 'example' + +pvp-bounds: both diff --git a/stack-ghc-9.10.yaml b/stack-ghc-9.10.yaml new file mode 100644 index 0000000..ef17196 --- /dev/null +++ b/stack-ghc-9.10.yaml @@ -0,0 +1,4 @@ +<<: !include stack-base.yaml + +resolver: lts-24.12 +extra-deps: [] diff --git a/stack-ghc-9.10.yaml.lock b/stack-ghc-9.10.yaml.lock new file mode 100644 index 0000000..6e6c820 --- /dev/null +++ b/stack-ghc-9.10.yaml.lock @@ -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: 0d0bb681dd5be9b930c8fc070d717aae757b9aed176ae6047d87624b46406816 + size: 726097 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/12.yaml + original: lts-24.12 diff --git a/stack-ghc-9.12.yaml b/stack-ghc-9.12.yaml new file mode 100644 index 0000000..ea4b986 --- /dev/null +++ b/stack-ghc-9.12.yaml @@ -0,0 +1,4 @@ +<<: !include stack-base.yaml + +resolver: nightly-2026-08-16 +extra-deps: [] diff --git a/stack-ghc-9.12.yaml.lock b/stack-ghc-9.12.yaml.lock new file mode 100644 index 0000000..2f96d08 --- /dev/null +++ b/stack-ghc-9.12.yaml.lock @@ -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: 38576406e65852b2665b3006437e74dfdb0a97977409b1c69de0986868f8c5b1 + size: 771158 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2026/8/16.yaml + original: nightly-2026-08-16 diff --git a/stack-ghc-9.2.yaml b/stack-ghc-9.2.yaml new file mode 100644 index 0000000..8bd25c9 --- /dev/null +++ b/stack-ghc-9.2.yaml @@ -0,0 +1,15 @@ +<<: !include stack-base.yaml + +resolver: lts-20.26 + +# This LTS predates the crypton fork entirely: it carries cryptonite, so the +# whole crypton stack has to be supplied, along with a tls new enough for +# crypton-connection. +extra-deps: + - crypton-connection-0.3.2 + - crypton-0.34 + - crypton-x509-1.7.7 + - crypton-x509-store-1.6.10 + - crypton-x509-system-1.6.7 + - crypton-x509-validation-1.6.14 + - tls-1.8.0 diff --git a/stack-ghc-9.2.yaml.lock b/stack-ghc-9.2.yaml.lock new file mode 100644 index 0000000..ce033f6 --- /dev/null +++ b/stack-ghc-9.2.yaml.lock @@ -0,0 +1,61 @@ +# 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: crypton-connection-0.3.2@sha256:4bf4bd26230d4b2282c920e1ab2972da36c496b8fcbe0b8456f95ef882b26ae6,1650 + pantry-tree: + sha256: 0b78d9517e55ec0e7e6153425928a9e424a6d40c4d327aee4226e99313438be0 + size: 394 + original: + hackage: crypton-connection-0.3.2 +- completed: + hackage: crypton-0.34@sha256:9e4b50d79d1fba681befa08151db7223d2b4bb72564853e8530e614105d53a1a,14577 + pantry-tree: + sha256: 85f438e6d328fc2e464c8914a08089ff312044b96ac155a25747512e440e0a12 + size: 23275 + original: + hackage: crypton-0.34 +- completed: + hackage: crypton-x509-1.7.7@sha256:89e227a3ded52d46c65fcc4e9b17a15d39e9f4252faa61cf9a89a3ef30f13722,2355 + pantry-tree: + sha256: b7396ef100c1a44533c94f97ba9539a22eff4114cfea6d4e4138ac2cd91bc48b + size: 1080 + original: + hackage: crypton-x509-1.7.7 +- completed: + hackage: crypton-x509-store-1.6.10@sha256:2df3c2e95579c2e6656a193dd71c263114e2ce71eb587a19b23751bc55db2ed3,1825 + pantry-tree: + sha256: d2e8bd03fe29559c43f044ee9902d3974ce5ce79c14bcb51429ff8157bdafaa4 + size: 406 + original: + hackage: crypton-x509-store-1.6.10 +- completed: + hackage: crypton-x509-system-1.6.7@sha256:023ed573d82983bc473a37a89e0434a085b413be9f68d07e085361056afd4637,1532 + pantry-tree: + sha256: c0ca49e6a9537f3fdb7b47c5cfe93f7d744a369bf9d089f3c668b9c2d97402b7 + size: 399 + original: + hackage: crypton-x509-system-1.6.7 +- completed: + hackage: crypton-x509-validation-1.6.14@sha256:c3ac343ec6baa116ffeacdba9f224f609359a43cbb62b3ef5cc1ba8bc5386b37,2349 + pantry-tree: + sha256: b79ad872647827a1310e4ab776154c24186cda189c329e9cf32f505ac1b04d2d + size: 639 + original: + hackage: crypton-x509-validation-1.6.14 +- completed: + hackage: tls-1.8.0@sha256:df02d83c9dcb765ea1c51c8b0a53cade44e1edb08496224c9844c64198c9ecc4,5801 + pantry-tree: + sha256: 1a21a24c3a54cfb1c33bb430a0843283605b831482d91339adf5e12f61c246d1 + size: 4897 + original: + hackage: tls-1.8.0 +snapshots: +- completed: + sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2 + size: 650475 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/26.yaml + original: lts-20.26 diff --git a/stack-ghc-9.4.yaml b/stack-ghc-9.4.yaml new file mode 100644 index 0000000..7625c9c --- /dev/null +++ b/stack-ghc-9.4.yaml @@ -0,0 +1,16 @@ +<<: !include stack-base.yaml + +resolver: lts-21.25 + +# crypton-connection is not in this LTS. These are the versions that shipped +# together in lts-22, which still build against the crypton and asn1 packages +# this snapshot carries. The newer crypton-x509 1.9 series is avoided on +# purpose: it wants crypton 1.1 and the crypton-asn1-* rewrite, which would +# mean replacing most of the snapshot's crypto stack. +extra-deps: + - crypton-connection-0.3.2 + - crypton-x509-1.7.7 + - crypton-x509-store-1.6.10 + - crypton-x509-system-1.6.7 + - crypton-x509-validation-1.6.14 + - tls-1.8.0 diff --git a/stack-ghc-9.4.yaml.lock b/stack-ghc-9.4.yaml.lock new file mode 100644 index 0000000..4520fe7 --- /dev/null +++ b/stack-ghc-9.4.yaml.lock @@ -0,0 +1,54 @@ +# 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: crypton-connection-0.3.2@sha256:4bf4bd26230d4b2282c920e1ab2972da36c496b8fcbe0b8456f95ef882b26ae6,1650 + pantry-tree: + sha256: 0b78d9517e55ec0e7e6153425928a9e424a6d40c4d327aee4226e99313438be0 + size: 394 + original: + hackage: crypton-connection-0.3.2 +- completed: + hackage: crypton-x509-1.7.7@sha256:89e227a3ded52d46c65fcc4e9b17a15d39e9f4252faa61cf9a89a3ef30f13722,2355 + pantry-tree: + sha256: b7396ef100c1a44533c94f97ba9539a22eff4114cfea6d4e4138ac2cd91bc48b + size: 1080 + original: + hackage: crypton-x509-1.7.7 +- completed: + hackage: crypton-x509-store-1.6.10@sha256:2df3c2e95579c2e6656a193dd71c263114e2ce71eb587a19b23751bc55db2ed3,1825 + pantry-tree: + sha256: d2e8bd03fe29559c43f044ee9902d3974ce5ce79c14bcb51429ff8157bdafaa4 + size: 406 + original: + hackage: crypton-x509-store-1.6.10 +- completed: + hackage: crypton-x509-system-1.6.7@sha256:023ed573d82983bc473a37a89e0434a085b413be9f68d07e085361056afd4637,1532 + pantry-tree: + sha256: c0ca49e6a9537f3fdb7b47c5cfe93f7d744a369bf9d089f3c668b9c2d97402b7 + size: 399 + original: + hackage: crypton-x509-system-1.6.7 +- completed: + hackage: crypton-x509-validation-1.6.14@sha256:c3ac343ec6baa116ffeacdba9f224f609359a43cbb62b3ef5cc1ba8bc5386b37,2349 + pantry-tree: + sha256: b79ad872647827a1310e4ab776154c24186cda189c329e9cf32f505ac1b04d2d + size: 639 + original: + hackage: crypton-x509-validation-1.6.14 +- completed: + hackage: tls-1.8.0@sha256:df02d83c9dcb765ea1c51c8b0a53cade44e1edb08496224c9844c64198c9ecc4,5801 + pantry-tree: + sha256: 1a21a24c3a54cfb1c33bb430a0843283605b831482d91339adf5e12f61c246d1 + size: 4897 + original: + hackage: tls-1.8.0 +snapshots: +- completed: + sha256: a81fb3877c4f9031e1325eb3935122e608d80715dc16b586eb11ddbff8671ecd + size: 640086 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/25.yaml + original: lts-21.25 diff --git a/stack-ghc-9.6.yaml b/stack-ghc-9.6.yaml new file mode 100644 index 0000000..28649ec --- /dev/null +++ b/stack-ghc-9.6.yaml @@ -0,0 +1,4 @@ +<<: !include stack-base.yaml + +resolver: lts-22.44 +extra-deps: [] diff --git a/stack-ghc-9.6.yaml.lock b/stack-ghc-9.6.yaml.lock new file mode 100644 index 0000000..8d134eb --- /dev/null +++ b/stack-ghc-9.6.yaml.lock @@ -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: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 + size: 721141 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/44.yaml + original: lts-22.44 diff --git a/stack-ghc-9.8.yaml b/stack-ghc-9.8.yaml new file mode 100644 index 0000000..34d7f18 --- /dev/null +++ b/stack-ghc-9.8.yaml @@ -0,0 +1,4 @@ +<<: !include stack-base.yaml + +resolver: lts-23.28 +extra-deps: [] diff --git a/stack-ghc-9.8.yaml.lock b/stack-ghc-9.8.yaml.lock new file mode 100644 index 0000000..a5db08c --- /dev/null +++ b/stack-ghc-9.8.yaml.lock @@ -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: 7e724f347d5969cb5e8dde9f9aae30996e3231c29d1dafd45f21f1700d4c4fcb + size: 684460 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/28.yaml + original: lts-23.28 diff --git a/stack.yaml b/stack.yaml index 909a4dc..545ce38 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1 @@ -resolver: lts-16.9 -packages: -- 'ftp-client' -- 'ftp-client-conduit' -- 'example' -extra-deps: [] -pvp-bounds: both +<<: !include stack-ghc-9.10.yaml diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..6e6c820 --- /dev/null +++ b/stack.yaml.lock @@ -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: 0d0bb681dd5be9b930c8fc070d717aae757b9aed176ae6047d87624b46406816 + size: 726097 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/12.yaml + original: lts-24.12 From e285b03fd7de7882a38fa3fe41c98d67d3b5c016 Mon Sep 17 00:00:00 2001 From: Paul Burns Date: Tue, 18 Aug 2026 19:53:18 -0400 Subject: [PATCH 3/4] Version ftp-client 0.5.1.7, ftp-client-conduit 0.5.0.6, add changelogs Both packages have published metadata changes on this branch -- corrected base bounds, a corrected resourcet bound and a relaxed crypton-connection bound -- with no API change, so both get a patch bump. Neither package had a changelog; seed one for each. --- ftp-client-conduit/CHANGELOG.md | 20 ++++++++++++++++++++ ftp-client-conduit/ftp-client-conduit.cabal | 3 ++- ftp-client-conduit/package.yaml | 3 ++- ftp-client/CHANGELOG.md | 13 +++++++++++++ ftp-client/ftp-client.cabal | 3 ++- ftp-client/package.yaml | 3 ++- 6 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 ftp-client-conduit/CHANGELOG.md create mode 100644 ftp-client/CHANGELOG.md diff --git a/ftp-client-conduit/CHANGELOG.md b/ftp-client-conduit/CHANGELOG.md new file mode 100644 index 0000000..c63620f --- /dev/null +++ b/ftp-client-conduit/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog for ftp-client-conduit + +## 0.5.0.6 + +* Correct the `resourcet` bound. `>= 1.2 && < 1.3` excluded `resourcet-1.3.0`, + which is what current Stackage snapshots carry, so the package could not build + against them at all. Only the `MonadResource` class is used from resourcet and + it is unchanged across that boundary, so the bound is now `< 1.4`. + +* Relax the `crypton-connection` bound from `>= 0.4` to `>= 0.3`, matching + `ftp-client`. Only `connectionClose` is used from that package, and 0.3 has it. + +* Correct the `base` bound. The package claimed `>= 4.7`, i.e. support back to + GHC 7.8, which has never been buildable. It is now `>= 4.16`, the oldest GHC + that is actually tested, and `tested-with` records the full set. + +## Earlier releases + +Prior to 0.5.0.6 this package had no changelog. See the git history at + for changes in earlier versions. diff --git a/ftp-client-conduit/ftp-client-conduit.cabal b/ftp-client-conduit/ftp-client-conduit.cabal index a439f8a..dba243a 100644 --- a/ftp-client-conduit/ftp-client-conduit.cabal +++ b/ftp-client-conduit/ftp-client-conduit.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: ftp-client-conduit -version: 0.5.0.5 +version: 0.5.0.6 synopsis: Transfer file with FTP and FTPS with Conduit description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. ftp-client-conduit uses conduit to stream files and data in constant space. category: Web @@ -24,6 +24,7 @@ tested-with: , GHC == 9.12.4 extra-source-files: README.md + CHANGELOG.md source-repository head type: git diff --git a/ftp-client-conduit/package.yaml b/ftp-client-conduit/package.yaml index c2877dd..df43bbb 100644 --- a/ftp-client-conduit/package.yaml +++ b/ftp-client-conduit/package.yaml @@ -1,5 +1,5 @@ name: ftp-client-conduit -version: 0.5.0.5 +version: 0.5.0.6 synopsis: Transfer file with FTP and FTPS with Conduit description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. ftp-client-conduit uses conduit to stream files and data in constant space. homepage: https://github.com/flipstone/ftp-client @@ -19,6 +19,7 @@ tested-with: extra-source-files: - README.md + - CHANGELOG.md git: https://github.com/flipstone/ftp-client diff --git a/ftp-client/CHANGELOG.md b/ftp-client/CHANGELOG.md new file mode 100644 index 0000000..d55224d --- /dev/null +++ b/ftp-client/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog for ftp-client + +## 0.5.1.7 + +* Correct the `base` bound. The package claimed `>= 4.8`, i.e. support back to + GHC 7.10, but no compiler that old can build it because `crypton-connection` + does not exist there. The bound is now `>= 4.16`, the oldest GHC that is + actually tested, and `tested-with` records the full set. + +## Earlier releases + +Prior to 0.5.1.7 this package had no changelog. See the git history at + for changes in earlier versions. diff --git a/ftp-client/ftp-client.cabal b/ftp-client/ftp-client.cabal index 2690807..84cd0b3 100644 --- a/ftp-client/ftp-client.cabal +++ b/ftp-client/ftp-client.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: ftp-client -version: 0.5.1.6 +version: 0.5.1.7 synopsis: Transfer files with FTP and FTPS description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. category: Web @@ -24,6 +24,7 @@ tested-with: , GHC == 9.12.4 extra-source-files: README.md + CHANGELOG.md source-repository head type: git diff --git a/ftp-client/package.yaml b/ftp-client/package.yaml index 4565f68..369da2e 100644 --- a/ftp-client/package.yaml +++ b/ftp-client/package.yaml @@ -1,5 +1,5 @@ name: ftp-client -version: 0.5.1.6 +version: 0.5.1.7 synopsis: Transfer files with FTP and FTPS description: ftp-client is a library for communicating with an FTP server. It works over both a clear channel or TLS. homepage: https://github.com/flipstone/ftp-client @@ -19,6 +19,7 @@ tested-with: extra-source-files: - README.md + - CHANGELOG.md git: https://github.com/flipstone/ftp-client From dc80cbed55e8c8179df36a996efb6de9eae81ef9 Mon Sep 17 00:00:00 2001 From: Paul Burns Date: Sat, 22 Aug 2026 17:21:23 -0400 Subject: [PATCH 4/4] Lint the sourced helper, and check fork pull requests Both from review feedback on #3. scripts/lib/run-in-container.sh had an unquoted $0, which word splits and glob expands on a path containing spaces or metacharacters. The shellcheck job did not catch it: the file has no shebang, so file(1) reports it as ASCII text and scripts/shellcheck, which filters on "shell script", never passed it to the linter. Adding a shebang -- inert in a sourced file -- brings it into the linted set, and shellcheck then does report SC2086 for the unquoted $0, so the check now covers what it previously missed. The workflow only ran on push. A fork pull request pushes to the fork, not here, so external contributions received no checks at all. Adding pull_request alongside push would have doubled every same-repo run: the concurrency group keys on github.ref_name, which is the branch for a push but /merge for a pull request, so the two never share a group and neither cancels the other. Scoping push to the default branch would have stopped branch pushes getting CI. Instead pull_request runs only when the head repository is not this one -- exactly the case where no push event fires here. Same-repo branches get one run from push, fork pull requests get one from pull_request, and nothing runs twice. This does not give same-repo pull requests merge-commit testing; they still test the pushed head. That is unreachable while keeping branch-push CI without duplicate runs, so it is a deliberate trade rather than an oversight. --- .github/workflows/main.yaml | 19 +++++++++++++++++++ scripts/lib/run-in-container.sh | 8 +++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9d9d73a..5806b33 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,10 @@ name: Build and Test on: push: + # Fork pull requests produce no push event in this repository, so without this + # trigger they get no checks at all. Same-repo pull requests are filtered out + # per job below, because their push event already covers them. + pull_request: defaults: run: @@ -14,6 +18,9 @@ concurrency: jobs: find-stack-yamls: name: Find stack.yamls for GHC Matrix + if: >- + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-24.04 outputs: stack-yamls: ${{ steps.set-output.outputs.stack-yamls }} @@ -24,6 +31,9 @@ jobs: build: name: Build and Test + if: >- + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository needs: find-stack-yamls runs-on: ubuntu-24.04 strategy: @@ -56,6 +66,9 @@ jobs: cabal-check: name: Cabal Check + if: >- + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-24.04 steps: - name: Checkout @@ -73,6 +86,9 @@ jobs: shellcheck: name: shellcheck + if: >- + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-24.04 steps: - name: Checkout @@ -88,6 +104,9 @@ jobs: cabal-latest-build: name: Cabal Build + if: >- + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-24.04 steps: - name: Checkout diff --git a/scripts/lib/run-in-container.sh b/scripts/lib/run-in-container.sh index 8e17cd2..d3a2026 100644 --- a/scripts/lib/run-in-container.sh +++ b/scripts/lib/run-in-container.sh @@ -1,3 +1,9 @@ +#!/bin/sh +# +# Sourced, not executed. The shebang is inert when sourced, but it makes file(1) +# classify this as a shell script so that scripts/shellcheck actually lints it -- +# without it the file is skipped and nothing here is ever checked. + if [ "$IN_DEV_CONTAINER" ]; then # Already in container, nothing to do : @@ -5,5 +11,5 @@ else # Script was run from outside the container, re-exec inside the container # with the same arguments docker compose build - exec docker compose run --rm dev $0 "$@" + exec docker compose run --rm dev "$0" "$@" fi