From ba430407d57e5a27ae75b56a81975f16e0bce43a Mon Sep 17 00:00:00 2001 From: adreasnow Date: Thu, 20 Aug 2026 18:48:05 +1000 Subject: [PATCH 1/3] refactor: Remove unused Haskell CI repository configurations Remove legacy repository configurations and associated bash scripts that are no longer required for workflow generation. --- .github/workflows/haskell-ci.yml | 230 ------------------------------- 1 file changed, 230 deletions(-) delete mode 100644 .github/workflows/haskell-ci.yml diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml deleted file mode 100644 index d21999a..0000000 --- a/.github/workflows/haskell-ci.yml +++ /dev/null @@ -1,230 +0,0 @@ -# This file is generated by `bellroy-github-actions`. -# Think twice before editing it directly. -name: Haskell CI - -on: - pull_request: - branches: - - master - workflow_dispatch: {} - -env: - CABAL_FILE_RELATIVE_PATH_NO_EXTENSION: github-actions - CABAL_VERSION: 3.16.0.0 - GHCUP_VERSION: 0.1.50.2 - LANG: C.UTF-8 - LANGUAGE_EDITION: Haskell2010 - LC_ALL: C.UTF-8 - -jobs: - generate-matrix: - name: Generate matrix from cabal - runs-on: ubuntu-24.04 - timeout-minutes: 30 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Extract the tested GHC versions - id: set-matrix - uses: kleidukos/get-tested@a55a250eac23bcc4bcd1cb22d77be61baea5a7e2 - with: - cabal-file: github-actions.cabal - ubuntu-version: 24.04 - - tests: - name: ${{ matrix.ghc }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - needs: - - generate-matrix - timeout-minutes: 30 - container: - image: buildpack-deps:jammy - strategy: - matrix: - include: - - ${{ (fromJSON(needs.generate-matrix.outputs.matrix)).include }} - env: - HCKIND: ghc - HCNAME: ghc-${{ matrix.ghc }} - HCVER: ${{ matrix.ghc }} - steps: - - name: apt - run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git libtinfo5 - mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION > "$HOME/.ghcup/bin/ghcup" - chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal $CABAL_VERSION || (cat "$HOME"/.ghcup/logs/*.* && false) - - - name: Set PATH and environment variables - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") - HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') - HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') - HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') - - { - echo "LANG=C.UTF-8" - echo "CABAL_DIR=$HOME/.cabal" - echo "CABAL_CONFIG=$HOME/.cabal/config" - echo "HC=$HC" - echo "HCPKG=$HCPKG" - echo "HADDOCK=$HADDOCK" - echo "CABAL=$HOME/.ghcup/bin/cabal-$CABAL_VERSION -vnormal+nowrap" - echo "HCNUMVER=$HCNUMVER" - echo "ARG_TESTS=--enable-tests" - echo "ARG_BENCH=--enable-benchmarks" - echo "HEADHACKAGE=false" - echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" - echo "GHCJSARITH=0" - } >> $GITHUB_ENV - - - name: env - run: | - env - - - name: write cabal config - run: | - mkdir -p $CABAL_DIR - cat >> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz - echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - cabal-plan --version - - - name: install doctest - run: | - $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.24.0' - doctest --version - - - name: checkout - uses: actions/checkout@v7 - with: - clean: false - path: source - - - name: initial cabal.project for sdist - run: | - touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project - cat cabal.project - - - name: sdist - run: | - mkdir -p sdist - $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist - - - name: unpack - run: | - mkdir -p unpacked - find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - - - name: generate cabal.project - run: | - PKGDIR_PROJECT="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*\/'$CABAL_FILE_RELATIVE_PATH_NO_EXTENSION'-[0-9.]*')" - echo "PKGDIR_PROJECT=${PKGDIR_PROJECT}" >> "$GITHUB_ENV" - rm -f cabal.project cabal.project.local - touch cabal.project - touch cabal.project.local - echo "packages: ${PKGDIR_PROJECT}" >> cabal.project - echo "package $CABAL_FILE_RELATIVE_PATH_NO_EXTENSION" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project - cat >> cabal.project <> cabal.project.local - cat cabal.project - cat cabal.project.local - - - name: dump install plan - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all - cabal-plan - - - name: restore cache (~/.cabal/store) - uses: actions/cache@v6 - with: - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }} - path: ~/.cabal/store - restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- - - - name: install dependencies - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all - - - name: build w/o tests - run: | - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - - - name: build - run: | - $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - - name: tests - run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - - - name: doctest - run: | - cd ${PKGDIR_PROJECT} || false - doctest -X$LANGUAGE_EDITION src - - - name: cabal check - run: | - cd ${PKGDIR_PROJECT} || false - ${CABAL} -vnormal check - - - name: haddock - run: | - $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - - - name: unconstrained build - run: | - rm -f cabal.project.local - $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all From db1a023e742899cea52425bd74c729a9f299575d Mon Sep 17 00:00:00 2001 From: adreasnow Date: Fri, 21 Aug 2026 18:19:53 +1000 Subject: [PATCH 2/3] Migrate all remaining haskell-ci workflows --- .github/workflows/haskell-ci.yml | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/haskell-ci.yml diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml new file mode 100644 index 0000000..14058a4 --- /dev/null +++ b/.github/workflows/haskell-ci.yml @@ -0,0 +1,71 @@ +name: Haskell CI +on: + pull_request: + branches: + - master + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + matrix: + name: Generate matrix from cabal file + runs-on: ubuntu-slim + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Extract the tested GHC versions + id: matrix + uses: kleidukos/get-tested@a55a250eac23bcc4bcd1cb22d77be61baea5a7e2 + with: + cabal-file: ${{ github.event.repository.name }}.cabal + ubuntu-version: latest + + tests: + name: ${{ matrix.ghc }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [matrix] + timeout-minutes: 30 + strategy: + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} + steps: + - name: Generate App token + id: token + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ vars.ACTIONS_CHECKOUT_APP_CLIENT_ID }} + private-key: ${{ secrets.ACTIONS_CHECKOUT_APP_PRIVATE_KEY }} + repositories: actions + + - name: Checkout action + uses: actions/checkout@v7 + with: + repository: bellroy/actions + token: ${{ steps.token.outputs.token }} + sparse-checkout: haskell-os-ci + ref: haskell-os-ci-v1 + + - name: Cabal test + uses: ./haskell-os-ci + with: + cabal-file-relative-path: ${{ github.event.repository.name }} + + tests-completion: + name: All tests jobs completed + runs-on: ubuntu-slim + if: ${{ !cancelled() }} + needs: [tests] + steps: + - name: Fan in matrix + run: | + if [[ "${{ needs.tests.result }}" == "failure" ]]; then + echo "::error::Testing one or more GHC versions have failed" + exit 1 + else + echo "::info::All tests have succeeded" + fi From 9e5d8f1a16d4aa8aeaf1aefabeb6196bf10047b8 Mon Sep 17 00:00:00 2001 From: Adrea Snow Date: Fri, 21 Aug 2026 18:23:36 +1000 Subject: [PATCH 3/3] Merge branch 'master' into actions-haskell-ci --- .github/workflows/haskell-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 14058a4..3105bb6 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -23,7 +23,7 @@ jobs: id: matrix uses: kleidukos/get-tested@a55a250eac23bcc4bcd1cb22d77be61baea5a7e2 with: - cabal-file: ${{ github.event.repository.name }}.cabal + cabal-file: github-actions.cabal ubuntu-version: latest tests: @@ -50,10 +50,11 @@ jobs: sparse-checkout: haskell-os-ci ref: haskell-os-ci-v1 - - name: Cabal test + - name: Validate build, tests, and packaging uses: ./haskell-os-ci with: - cabal-file-relative-path: ${{ github.event.repository.name }} + cabal-file-relative-path: github-actions + language-edition: Haskell2010 tests-completion: name: All tests jobs completed