Skip to content
Merged
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
37 changes: 37 additions & 0 deletions .github/actions/setup-haskell/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: MPL-2.0
name: Cached Haskell toolchain
description: Restore the installed compiler before configuring GHC and Cabal
inputs:
ghc-version:
description: Exact GHC version
required: true
outputs:
cabal-store:
description: Cabal dependency store
value: ${{ steps.haskell.outputs.cabal-store }}
runs:
using: composite
steps:
- name: Locate GHCup installation
if: runner.os != 'Windows'
id: root
shell: bash
run: |
mkdir -p "$HOME/.ghcup"
toolchain_root="$(cd "$HOME/.ghcup" && pwd -P)"
echo "path=$toolchain_root" >> "$GITHUB_OUTPUT"
- name: Restore installed compiler
if: runner.os != 'Windows'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
${{ steps.root.outputs.path }}/ghc/${{ inputs.ghc-version }}
${{ steps.root.outputs.path }}/bin
${{ steps.root.outputs.path }}/cabal/3.16.1.0
key: toolchain-v2-${{ runner.os }}-${{ runner.arch }}-${{ env.ImageOS }}-${{ env.ImageVersion }}-ghc-${{ inputs.ghc-version }}-cabal-3.16.1.0
- uses: haskell-actions/setup@7fd2bb5ca789761088fbc831406b2910e47e56f1 # v2
id: haskell
with:
ghc-version: ${{ inputs.ghc-version }}
cabal-version: '3.16.1.0'
cabal-update: false
16 changes: 16 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: MPL-2.0
name: Full compatibility

on:
schedule:
- cron: '0 3 * * 0'
workflow_dispatch:

permissions:
contents: read

jobs:
compatibility:
uses: ./.github/workflows/validate.yml
with:
full-matrix: true
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ jobs:
python-version: '3.12'
cache: pip
cache-dependency-path: requirements-docs.txt
- uses: haskell-actions/setup@7fd2bb5ca789761088fbc831406b2910e47e56f1 # v2
- uses: ./.github/actions/setup-haskell
with:
ghc-version: '9.10.3'
cabal-version: '3.16.1.0'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: build-docs/cabal
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,37 @@ on:
pull_request:
paths-ignore: ['docs/**', 'mkdocs.yml', 'requirements-docs.txt', 'tools/build_docs.py', 'README.md']
workflow_dispatch:
inputs:
full-matrix:
description: Run all compiler and portability combinations
type: boolean
default: true
workflow_call:
inputs:
full-matrix:
type: boolean
default: false

permissions:
contents: read

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

jobs:
linux:
strategy:
fail-fast: false
matrix:
ghc: ['9.6.7', '9.10.3']
buildtype: [debug, release]
include: ${{ fromJSON(inputs.full-matrix && '[{"ghc":"9.6.7","buildtype":"debug","primary":false},{"ghc":"9.6.7","buildtype":"release","primary":false},{"ghc":"9.10.3","buildtype":"debug","primary":false},{"ghc":"9.10.3","buildtype":"release","primary":true}]' || '[{"ghc":"9.10.3","buildtype":"debug","primary":true}]') }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: haskell-actions/setup@7fd2bb5ca789761088fbc831406b2910e47e56f1 # v2
- uses: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.16.1.0'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
Expand All @@ -52,7 +60,7 @@ jobs:
sudo apt-get install -y liblapacke-dev libopenblas-dev zlib1g-dev cmake ninja-build clang
python -m pip install meson==1.8.5 numpy cffi
- name: Wave compiler
if: matrix.ghc == '9.10.3' && matrix.buildtype == 'release'
if: matrix.primary
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -66,7 +74,7 @@ jobs:
- name: Build and integration tests
run: |
wave_tests=auto
if [ '${{ matrix.ghc }}' = '9.10.3' ] && [ '${{ matrix.buildtype }}' = release ]; then
if [ '${{ matrix.primary }}' = true ]; then
wave_tests=enabled
fi
meson setup build-ci --buildtype=${{ matrix.buildtype }} -Doffline=true -Dwerror=true -Dpython_bindings=enabled -Dwave_bindings="$wave_tests" -Dbenchmarks=true
Expand All @@ -75,10 +83,10 @@ jobs:
python tools/check_install.py build-ci
python tools/check_abi.py build-ci/libhmath.so
- name: Sanitized metadata and DLPack fuzzing
if: matrix.ghc == '9.10.3' && matrix.buildtype == 'release'
if: matrix.primary
run: python tools/run_fuzz.py --runs=100000 --output=build-ci/fuzz.log
- name: Native benchmark smoke
if: matrix.ghc == '9.10.3' && matrix.buildtype == 'release'
if: matrix.primary
run: |
python tools/benchmark.py --library=build-ci/libhmath.so --native=build-ci/hmath-native-benchmark --iterations=10 --output=build-ci/benchmark.json
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
Expand All @@ -95,11 +103,10 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: haskell-actions/setup@7fd2bb5ca789761088fbc831406b2910e47e56f1 # v2
- uses: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: '9.10.3'
cabal-version: '3.16.1.0'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
Expand Down Expand Up @@ -133,6 +140,7 @@ jobs:
run: cabal bench hmath-criterion -fvalidation-frameworks -fcriterion-benchmarks --benchmark-options='--iters 1'

portability-build:
if: inputs.full-matrix
# Build probes do not establish full native platform support.
strategy:
fail-fast: false
Expand All @@ -141,11 +149,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: haskell-actions/setup@7fd2bb5ca789761088fbc831406b2910e47e56f1 # v2
- uses: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: '9.10.3'
cabal-version: '3.16.1.0'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
Expand Down
Loading