Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
18 changes: 10 additions & 8 deletions .github/actions/base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ runs:
shell: bash
run: cp cabal.project.ci cabal.project

- name: Windows quirks - Configure environment for libclang
shell: bash
if: ${{ startsWith(inputs.runner, 'windows') }}
run: |
# Set library path for linker to find import libraries (.lib files)
echo "LIBRARY_PATH=$LLVM_PATH/lib" >> "$GITHUB_ENV"

echo "$LLVM_PATH/lib" >> "$GITHUB_PATH"
echo "$LLVM_PATH/bin" >> "$GITHUB_PATH"

- name: Dry build (for cache key)
shell: bash
run: cabal build all --dry-run
Expand Down Expand Up @@ -85,14 +95,6 @@ runs:
if: runner.os == 'Linux'
uses: ./.github/actions/build-manual-ubuntu

- name: Windows quirks - Manual requires Clang version coming with GHC
shell: bash
if: ${{ startsWith(inputs.runner, 'windows') }}
run: |
echo '### ls "C:\tools\ghc-${{ inputs.ghc }}\mingw\bin"'
ls "C:\tools\ghc-${{ inputs.ghc }}\mingw\bin"
echo "C:\tools\ghc-${{ inputs.ghc }}\mingw\bin" >> "$GITHUB_PATH"

- name: Build manual (Windows)
if: runner.os == 'Windows'
uses: ./.github/actions/build-manual-windows
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/setup-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ runs:
echo '### ls $LLVM_PATH'
ls "$LLVM_PATH"
echo '### ls $LLVM_PATH/bin'
ls "$LLVM_PATH/bin"
ls "$LLVM_PATH/bin"
echo '### ls $LLVM_PATH/lib'
ls "$LLVM_PATH/lib" || echo "lib directory not found or empty"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Compile Fixtures
name: Compile and Generate Haddocks for Fixtures

on:
push:
Expand All @@ -23,8 +23,8 @@ defaults:
shell: bash

jobs:
compile-fixtures:
name: Compile Fixtures (${{ matrix.runner }}, GHC ${{ matrix.ghc-version }}, Cabal ${{ matrix.cabal-version }}, LLVM ${{matrix.llvm-version }})
compile-and-generate-haddocks-fixtures:
name: Compile & Generate Haddocks for Fixtures (${{ matrix.runner }}, GHC ${{ matrix.ghc-version }}, Cabal ${{ matrix.cabal-version }}, LLVM ${{matrix.llvm-version }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 30

Expand All @@ -33,6 +33,10 @@ jobs:
# We run the workflow only once, but using a matrix makes it easy to
# change these settings in the future. As an added benefit, we can refer
# to the matrix entries in the job name.
#
# NOTE: This workflow both compiles fixtures AND generates Haddock documentation.
# Since Haddock compiles files internally, this single pass validates both
# compilation and documentation in one efficient step.
matrix:
runner: ['ubuntu-latest']
ghc-version: ['9.4']
Expand All @@ -57,7 +61,7 @@ jobs:

- name: 🛠️ Configure
run: |
cabal configure --disable-test --disable-benchmark --disable-documentation --ghc-options="-Werror"
cp cabal.project.base.ci cabal.project.local
cat "cabal.project.local"

- name: 💾 Generate Cabal plan
Expand Down Expand Up @@ -89,7 +93,7 @@ jobs:
- name: 🏗️ Build hs-bindgen
run: cabal build hs-bindgen-runtime c-expr-runtime

- name: 🧪 Compile fixtures
- name: 🧪 Compile and generate Haddocks for fixtures
run: |
chmod +x scripts/ci/compile-fixtures.sh
scripts/ci/compile-fixtures.sh
chmod +x scripts/ci/compile-and-generate-haddocks-fixtures.sh
scripts/ci/compile-and-generate-haddocks-fixtures.sh
192 changes: 192 additions & 0 deletions .github/workflows/comprehensive-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
name: Comprehensive CI "Release" flow

# Manual trigger only - for pre-release validation and comprehensive testing
# on:
# workflow_dispatch:

on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# Test all LLVM versions (14-21) on recommended configuration
test-all-llvm-and-ghc-versions:
name: Test All LLVM and GHC Versions (${{ matrix.runner }}, GHC ${{ matrix.ghc-version }}, LLVM ${{ matrix.llvm-version }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
# runner: [windows-latest, ubuntu-latest, macos-latest]
runner: [windows-latest]
ghc-version: ['9.4.8']
llvm-version: ['14']
# ghc-version: ['9.2.8', '9.4.8', '9.6.7', '9.8.4', '9.10.3', '9.12.2']
# llvm-version: ['14', '16', '18', '20', '21']
# exclude:
# # LLVM 21 not available on macOS ARM64
# - runner: macos-latest
# llvm-version: '21'

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- name: Checkout
uses: actions/checkout@v4

- name: Build and test `hs-bindgen` and manual
uses: ./.github/actions/base
with:
runner: ${{ matrix.runner }}
ghc: ${{ matrix.ghc-version }}
llvm: ${{ matrix.llvm-version }}

# cabal-check:
# name: Cabal check (${{ matrix.package }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# package:
# - ansi-diff
# - c-expr-runtime
# - c-expr-dsl
# - hs-bindgen
# - hs-bindgen-runtime
# - hs-bindgen-test-runtime
# cabal-version: ['3.16']
# ghc-version: ['9.4.8']
# steps:
# - name: 📥 Checkout repository
# uses: actions/checkout@v5
#
# - name: 🛠️ Setup Haskell
# id: setup-haskell
# uses: haskell-actions/setup@v2
# with:
# ghc-version: ${{ matrix.ghc-version }}
# cabal-version: ${{ matrix.cabal-version }}
#
# - name: 💾 Run cabal check
# run: |
# cd ${{ matrix.package }}
# cabal check

# sdist-build:
# name: Build from sdist (ubuntu-latest, GHC ${{ matrix.ghc }}, LLVM ${{ matrix.llvm }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# cabal-version: ['3.16']
# ghc-version: ['9.2.8', '9.4.8', '9.6.7', '9.8.4', '9.10.3', '9.12.2']
# llvm-version: ['14', '16', '18', '20', '21']
# steps:
# - name: 📥 Checkout repository
# uses: actions/checkout@v5
#
# - name: 🛠️ Setup Haskell
# id: setup-haskell
# uses: haskell-actions/setup@v2
# with:
# ghc-version: ${{ matrix.ghc-version }}
# cabal-version: ${{ matrix.cabal-version }}
#
# - name: 🛠️ Setup LLVM/Clang
# uses: ./.github/actions/setup-llvm
# with:
# version: ${{ matrix.llvm-version }}
#
# - name: 🛠️ cabal.project
# run: cp cabal.project.ci cabal.project
#
# - name: 💾 Generate all sdists
# run: cabal sdist all
#
# - name: 💾 Test all sdists can be built
# run: |
# TEMP_DIR=$(mktemp -d)
#
# # Extract all sdists
# for SDIST_FILE in dist-newstyle/sdist/*.tar.gz; do
# tar xzf "$SDIST_FILE" -C "$TEMP_DIR"
# done
#
# cd "$TEMP_DIR"
#
# # Create cabal.project with all extracted packages
# echo "packages:" > cabal.project
# for dir in */; do
# echo " ${dir%/}" >> cabal.project
# done
#
# cabal build all

# # Build Haddock documentation for all packages
# build-haddock:
# name: Build Haddock (ubuntu-latest, GHC ${{ matrix.ghc-version }}, LLVM ${{ matrix.llvm-version }})
# runs-on: ubuntu-latest
# timeout-minutes: 30
# strategy:
# fail-fast: true
# matrix:
# cabal-version: ['3.16']
# # Doesn't run GHC 9.2.8 due to a haddock bug
# #
# ghc-version: [ '9.4.8', '9.6.7', '9.8.4', '9.10.3', '9.12.2']
# llvm-version: ['14', '16', '18', '20', '21']
# steps:
# - name: 📥 Checkout repository
# uses: actions/checkout@v5
#
# - name: 🛠️ Setup Haskell
# id: setup-haskell
# uses: haskell-actions/setup@v2
# with:
# ghc-version: ${{ matrix.ghc-version }}
# cabal-version: ${{ matrix.cabal-version }}
#
# - name: 🛠️ Setup LLVM/Clang
# uses: ./.github/actions/setup-llvm
# with:
# version: ${{ matrix.llvm-version }}
#
# - name: 🛠️ cabal.project
# run: cp cabal.project.ci cabal.project
#
# - name: 💾 Generate Cabal plan
# run: cabal build all --dry-run
#
# - name: 💾 Restore Cabal dependencies
# id: cache-cabal-restore
# uses: actions/cache/restore@v4
# env:
# key: haddock-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-llvm-${{ matrix.llvm-version }}
# with:
# path: ${{ steps.setup-haskell.outputs.cabal-store }}
# key: ${{ env.key }}-plan-${{ hashFiles('./dist-newstyle/cache/plan.json') }}
# restore-keys: ${{ env.key }}-
#
# - name: 🛠️ Build dependencies with Haddock
# run: cabal build all --only-dependencies --enable-documentation
#
# - name: 💾 Save Cabal dependencies
# uses: actions/cache/save@v4
# if: ${{ steps.cache-cabal-restore.outputs.cache-hit != 'true' }}
# with:
# path: ${{ steps.setup-haskell.outputs.cabal-store }}
# key: ${{ steps.cache-cabal-restore.outputs.cache-primary-key }}
#
# - name: 🏗️ Build Haddock for all packages
# run: cabal haddock all --haddock-for-hackage
File renamed without changes.
4 changes: 2 additions & 2 deletions hs-bindgen/hs-bindgen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ test-suite test-th

test-suite test-pp
type: exitcode-stdio-1.0
main-is: ../th/test-th.hs
hs-source-dirs: test/pp
main-is: test-th.hs
hs-source-dirs: test/pp test/th
include-dirs: examples
default-language: GHC2021
other-modules:
Expand Down
Loading
Loading