From 694ba201c32354344dcc93face4d3d9080809f3e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 01:36:17 +0700 Subject: [PATCH 01/19] Add CI for MicroHs --- .github/workflows/build.yml | 63 ------------------------------------- .github/workflows/mhs.yml | 14 +++++++++ strip.cabal | 3 +- 3 files changed, 15 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/mhs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 2bdf1bb..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: build - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: '0 0 * * *' - -jobs: - build: - name: ${{ matrix.os }} / GHC ${{ matrix.ghc }} - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - ghc: - - '9.8' - - '9.10' - - '9.12' - include: - - os: macos-latest - ghc: system - - os: windows-latest - ghc: system - - steps: - - uses: actions/checkout@v4 - - uses: hspec/setup-haskell@v1 - with: - ghc-version: ${{ matrix.ghc }} - - - name: Install dependencies - run: | - cabal update - cabal configure --enable-tests --enable-benchmarks # NOTE: --enable-tests is necessary due to https://github.com/haskell/cabal/issues/5079 - cabal build --only-dependencies - - - name: Build - run: cabal build all - - - name: Run tests - run: cabal test all --test-show-details=direct - env: - HSPEC_OPTIONS: --color - - success: - needs: build - runs-on: ubuntu-latest - if: always() # this is required as GitHub considers "skipped" jobs as "passed" when checking branch protection rules - - steps: - - run: exit 1 - if: needs.build.result != 'success' diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml new file mode 100644 index 0000000..fe2329a --- /dev/null +++ b/.github/workflows/mhs.yml @@ -0,0 +1,14 @@ +name: MicroHs + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: sol/setup-MicroHs@nightly + - run: mcabal -r install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core + - run: mcabal -r install "--git=https://github.com/hspec/hspec" hspec + - run: mcabal -r build diff --git a/strip.cabal b/strip.cabal index 36d8406..cd46757 100644 --- a/strip.cabal +++ b/strip.cabal @@ -25,8 +25,7 @@ library Paths_strip default-language: Haskell2010 -test-suite spec - type: exitcode-stdio-1.0 +executable spec main-is: Spec.hs hs-source-dirs: test From 9e17d66b1834f1de2ed41a7f2920874edeb3a6fb Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 04:23:39 +0700 Subject: [PATCH 02/19] Update mhs.yml --- .github/workflows/mhs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index fe2329a..f59d508 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -10,5 +10,7 @@ jobs: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - run: mcabal -r install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core + - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions + - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions - run: mcabal -r install "--git=https://github.com/hspec/hspec" hspec - run: mcabal -r build From 0fbd0ea3778ceffe8dd83945f4d2bae7975da636 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 04:28:10 +0700 Subject: [PATCH 03/19] Update mhs.yml --- .github/workflows/mhs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index f59d508..3eb6589 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -9,8 +9,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly + - run: mcabal -r install "--git=https://github.com/hspec/hspec" hspec - run: mcabal -r install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions - - run: mcabal -r install "--git=https://github.com/hspec/hspec" hspec - run: mcabal -r build From b64521c47333a5639c7e3395c992bc920a4c7fe6 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 04:47:51 +0700 Subject: [PATCH 04/19] Update mhs.yml --- .github/workflows/mhs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index 3eb6589..73f4190 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -9,8 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - run: mcabal -r install "--git=https://github.com/hspec/hspec" hspec - - run: mcabal -r install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core - - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions - - run: mcabal -r install --git=https://github.com/ekmett/exceptions exceptions + - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core + - run: mcabal install hspec-discover + - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" hspec - run: mcabal -r build From 26344892b6b30d4804a067f028d620bee7b25a89 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 05:09:06 +0700 Subject: [PATCH 05/19] Update Spec.hs --- test/Spec.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/Spec.hs b/test/Spec.hs index a824f8c..18b96d5 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1 +1,7 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +module Main where + +import Test.Hspec +import qualified Data.String.StripSpec + +main :: IO () +main = hspec Data.String.StripSpec.spec From 8c1bc53642c72d0faed16bda52937211da145877 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 05:14:06 +0700 Subject: [PATCH 06/19] Update mhs.yml --- .github/workflows/mhs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index 73f4190..8609d10 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -13,3 +13,4 @@ jobs: - run: mcabal install hspec-discover - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" hspec - run: mcabal -r build + - run: dist-mcabal/bin/mhs/spec From 85e92715a99d5ca957942d2805693029ed71fb45 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 05:30:35 +0700 Subject: [PATCH 07/19] Update mhs.yml --- .github/workflows/mhs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index 8609d10..0a6ad12 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core + - run: mcabal install "--git=https://github.com/hspec/hspec" --branch=micro-hs --dir=hspec-core hspec-core - run: mcabal install hspec-discover - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" hspec - run: mcabal -r build From 40b0186c2bd2adef8d99d50e398ce8c103140322 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 05:32:06 +0700 Subject: [PATCH 08/19] Update mhs.yml --- .github/workflows/mhs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml index 0a6ad12..8609d10 100644 --- a/.github/workflows/mhs.yml +++ b/.github/workflows/mhs.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - run: mcabal install "--git=https://github.com/hspec/hspec" --branch=micro-hs --dir=hspec-core hspec-core + - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core - run: mcabal install hspec-discover - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" hspec - run: mcabal -r build From df33592e79ed35860310425532897be3f6796c7d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 06:21:22 +0700 Subject: [PATCH 09/19] Update and rename mhs.yml to micro-hs.yml --- .github/workflows/mhs.yml | 16 ---------------- .github/workflows/micro-hs.yml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/mhs.yml create mode 100644 .github/workflows/micro-hs.yml diff --git a/.github/workflows/mhs.yml b/.github/workflows/mhs.yml deleted file mode 100644 index 8609d10..0000000 --- a/.github/workflows/mhs.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: MicroHs - -on: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: sol/setup-MicroHs@nightly - - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" --dir=hspec-core hspec-core - - run: mcabal install hspec-discover - - run: mcabal install "--git=https://github.com/hspec/hspec --branch=micro-hs" hspec - - run: mcabal -r build - - run: dist-mcabal/bin/mhs/spec diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml new file mode 100644 index 0000000..8e574a2 --- /dev/null +++ b/.github/workflows/micro-hs.yml @@ -0,0 +1,13 @@ +name: MicroHs + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: sol/setup-MicroHs@nightly + - run: mcabal -r build + - run: dist-mcabal/bin/mhs/spec From cc459ab9a8da106e41b0c31e70997bdf859e1ebd Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 08:39:02 +0700 Subject: [PATCH 10/19] Add files via upload --- .github/workflows/build.yml.txt | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/build.yml.txt diff --git a/.github/workflows/build.yml.txt b/.github/workflows/build.yml.txt new file mode 100644 index 0000000..2bdf1bb --- /dev/null +++ b/.github/workflows/build.yml.txt @@ -0,0 +1,63 @@ +name: build + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '0 0 * * *' + +jobs: + build: + name: ${{ matrix.os }} / GHC ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: + - ubuntu-latest + ghc: + - '9.8' + - '9.10' + - '9.12' + include: + - os: macos-latest + ghc: system + - os: windows-latest + ghc: system + + steps: + - uses: actions/checkout@v4 + - uses: hspec/setup-haskell@v1 + with: + ghc-version: ${{ matrix.ghc }} + + - name: Install dependencies + run: | + cabal update + cabal configure --enable-tests --enable-benchmarks # NOTE: --enable-tests is necessary due to https://github.com/haskell/cabal/issues/5079 + cabal build --only-dependencies + + - name: Build + run: cabal build all + + - name: Run tests + run: cabal test all --test-show-details=direct + env: + HSPEC_OPTIONS: --color + + success: + needs: build + runs-on: ubuntu-latest + if: always() # this is required as GitHub considers "skipped" jobs as "passed" when checking branch protection rules + + steps: + - run: exit 1 + if: needs.build.result != 'success' From 5f0a78dc7d4d99eb199b9fce7d40692197eefd65 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 08:39:54 +0700 Subject: [PATCH 11/19] Rename build.yml.txt to build.yml --- .github/workflows/{build.yml.txt => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yml.txt => build.yml} (100%) diff --git a/.github/workflows/build.yml.txt b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml.txt rename to .github/workflows/build.yml From 1f4cc0bc391d18975898e68d3f7786d9dd087bd6 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 10:54:06 +0700 Subject: [PATCH 12/19] Update Spec.hs --- test/Spec.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test/Spec.hs b/test/Spec.hs index 18b96d5..a824f8c 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1,7 +1 @@ -module Main where - -import Test.Hspec -import qualified Data.String.StripSpec - -main :: IO () -main = hspec Data.String.StripSpec.spec +{-# OPTIONS_GHC -F -pgmF hspec-discover #-} From 8dd3e8c7ced2a1784830a363d60253405156dd0b Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 10:56:43 +0700 Subject: [PATCH 13/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index 8e574a2..8eba9d3 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -9,5 +9,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly + - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs - run: mcabal -r build - run: dist-mcabal/bin/mhs/spec From 369e036aed77917d6bedb1dc3fb10d4a1f4f373f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 10:58:37 +0700 Subject: [PATCH 14/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index 8eba9d3..a32e9ad 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -9,6 +9,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs + - run: hspec-discover test/Spec.hs > test/Spec.hs - run: mcabal -r build - run: dist-mcabal/bin/mhs/spec From 7fdf70e443241cc8ad05ce030bc47171fb09e222 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 11:00:06 +0700 Subject: [PATCH 15/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index a32e9ad..8eba9d3 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -9,6 +9,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - run: hspec-discover test/Spec.hs > test/Spec.hs + - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs - run: mcabal -r build - run: dist-mcabal/bin/mhs/spec From ea94da410335ebecceb16c8f9576ef06b67af6fd Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 11:14:08 +0700 Subject: [PATCH 16/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index 8eba9d3..c2a481a 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -9,6 +9,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly + - uses: actions/checkout@v4 + with: + repository: sol/MicroCabal + path: MicroCabal + - run: cd MicroCabal && mcabal install - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs - - run: mcabal -r build + - run: mcabal -r test - run: dist-mcabal/bin/mhs/spec From 2d020f027342e186cb7a2b2936e41700792f058e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 11:14:59 +0700 Subject: [PATCH 17/19] Update strip.cabal --- strip.cabal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strip.cabal b/strip.cabal index cd46757..36d8406 100644 --- a/strip.cabal +++ b/strip.cabal @@ -25,7 +25,8 @@ library Paths_strip default-language: Haskell2010 -executable spec +test-suite spec + type: exitcode-stdio-1.0 main-is: Spec.hs hs-source-dirs: test From 9c6203546178c3a9c5dc43a2e8c867cba29776cb Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 11:24:30 +0700 Subject: [PATCH 18/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index c2a481a..572acb7 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -16,4 +16,3 @@ jobs: - run: cd MicroCabal && mcabal install - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs - run: mcabal -r test - - run: dist-mcabal/bin/mhs/spec From 11130c8120a7f70a8744682348eb8ef98afc51be Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Dec 2025 11:52:30 +0700 Subject: [PATCH 19/19] Update micro-hs.yml --- .github/workflows/micro-hs.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/micro-hs.yml b/.github/workflows/micro-hs.yml index 572acb7..025b838 100644 --- a/.github/workflows/micro-hs.yml +++ b/.github/workflows/micro-hs.yml @@ -9,10 +9,5 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sol/setup-MicroHs@nightly - - uses: actions/checkout@v4 - with: - repository: sol/MicroCabal - path: MicroCabal - - run: cd MicroCabal && mcabal install - run: hspec-discover test/Spec.hs test/Spec.hs test/Spec.hs - run: mcabal -r test