Repository navigation
165 lines (159 loc) · 7.45 KB
/
Copy pathvalidate.yml
File metadata and controls
165 lines (159 loc) · 7.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# SPDX-License-Identifier: MPL-2.0
name: Validate
on:
push:
branches: [master]
paths-ignore: ['.github/workflows/docs.yml', 'docs/**', 'mkdocs.yml', 'requirements-docs.txt', 'tools/build_docs.py', 'tools/check_api_docs.py', 'tools/check_haskell_doc_examples.py', 'tools/check_docs_links.py', 'tools/haskell_reference.py', 'README.md']
pull_request:
paths-ignore: ['.github/workflows/docs.yml', 'docs/**', 'mkdocs.yml', 'requirements-docs.txt', 'tools/build_docs.py', 'tools/check_api_docs.py', 'tools/check_haskell_doc_examples.py', 'tools/check_docs_links.py', 'tools/haskell_reference.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.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux:
strategy:
fail-fast: false
matrix:
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: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: ${{ matrix.ghc }}
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cabal/packages
${{ steps.haskell.outputs.cabal-store }}
dist-newstyle
build-ci/cabal
build-ci/numeric-oracle
build-interchange/cabal
key: cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.buildtype }}-${{ hashFiles('hmath.cabal', 'cabal.project', 'src/**', 'cbits/**', 'test/**', 'bench/**') }}
restore-keys: cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.buildtype }}-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: pyproject.toml
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblapacke-dev libopenblas-dev zlib1g-dev cmake ninja-build clang
python -m pip install -r requirements-codegen.txt meson==1.8.5 numpy cffi
- name: Wave compiler
if: matrix.primary
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p "$RUNNER_TEMP/wave"
gh release download v0.2.1-pre-beta --repo wavefnd/Wave --pattern wave-v0.2.1-pre-beta-x86_64-linux-gnu.tar.gz --dir "$RUNNER_TEMP/wave"
cd "$RUNNER_TEMP/wave"
echo '4e5daf46a93414e00b8ea073eda09e4b7aa7d248cc03f2aeb965a36fc9b0fef0 wave-v0.2.1-pre-beta-x86_64-linux-gnu.tar.gz' | sha256sum --check
tar -xzf wave-v0.2.1-pre-beta-x86_64-linux-gnu.tar.gz
test -n "$(find "$RUNNER_TEMP/wave" -type f -name wavec -print -quit)"
find "$RUNNER_TEMP/wave" -type f -name wavec -printf '%h\n' >> "$GITHUB_PATH"
- name: Build and integration tests
run: |
wave_tests=auto
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
meson compile -C build-ci
meson test -C build-ci --print-errorlogs
python tools/check_install.py build-ci
python tools/check_abi.py build-ci/libhmath.so
- name: Sanitized metadata and DLPack fuzzing
if: matrix.primary
run: python tools/run_fuzz.py --runs=100000 --output=build-ci/fuzz.log
- name: Native benchmark smoke
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
if: always()
with:
name: validation-${{ matrix.ghc }}-${{ matrix.buildtype }}
path: |
build-ci/meson-logs/
build-ci/hmath-build.json
build-ci/fuzz.log
build-ci/benchmark.*
extended:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: '9.10.3'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cabal/packages
${{ steps.haskell.outputs.cabal-store }}
dist-newstyle
build-ci/cabal
build-ci/numeric-oracle
build-interchange/cabal
key: cabal-extended-${{ runner.os }}-9.10.3-${{ hashFiles('hmath.cabal', 'cabal.project', 'src/**', 'cbits/**', 'test/**', 'bench/**') }}
restore-keys: |
cabal-extended-${{ runner.os }}-9.10.3-
cabal-${{ runner.os }}-9.10.3-release-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: pyproject.toml
- name: Extended validation dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblapacke-dev libopenblas-dev zlib1g-dev
python -m pip install numpy scipy h5py pyarrow onnx
cabal update
- name: Build all extended components with one plan
run: cabal build test:hmath-properties bench:hmath-criterion exe:hmath-interchange-driver -fvalidation-frameworks -fcriterion-benchmarks -j2
- name: Properties and interchange
run: |
cabal test hmath-properties -fvalidation-frameworks -fcriterion-benchmarks --test-show-details=direct
python tools/check_interchange.py --builddir=dist-newstyle --cabal-flag=validation-frameworks --cabal-flag=criterion-benchmarks --require-optional
- name: Criterion fixture smoke
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
matrix:
os: [macos-15, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: ./.github/actions/setup-haskell
id: haskell
with:
ghc-version: '9.10.3'
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
${{ steps.haskell.outputs.cabal-store }}
dist-newstyle
key: cabal-portability-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('hmath.cabal', 'cabal.project', 'src/**', 'cbits/**') }}
restore-keys: cabal-portability-${{ runner.os }}-${{ runner.arch }}-
- run: cabal build --offline lib:hmath flib:hmath -f-interchange-zlib --ghc-options="-Wall -Werror"