-
Notifications
You must be signed in to change notification settings - Fork 7
168 lines (161 loc) · 5.59 KB
/
ci.yaml
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
166
167
168
name: ci
on:
push:
branches:
- master
pull_request: {}
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: ['9.6', '9.4', '9.2', '9.0', '8.10', '8.8.4', '8.8.2', '8.8.1', '8.6', '8.4']
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- uses: actions/cache@v3
name: Cache cabal stuff
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- name: Build
run: |
echo packages:. > cabal.project
echo tests:True >> cabal.project
echo "constraints:quickcheck-classes -semigroupoids -aeson -semirings" >> cabal.project
cabal test --test-show-details=direct
cabal bench --benchmark-option=-l
cabal sdist
cabal check
- name: Build without SIMD
run: |
cabal test -f-simd --test-show-details=direct
- name: Haddock
if: ${{ matrix.ghc != '8.0' && matrix.ghc != '8.2' && matrix.ghc != '8.4' }}
run: cabal haddock
i386:
needs: build
runs-on: ubuntu-latest
container:
image: i386/ubuntu:bionic
steps:
- name: Install
run: |
apt-get update -y
apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl libncurses5 libtinfo5 libncurses5-dev libtinfo-dev
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh
- uses: actions/checkout@v1
- name: Test
run: |
source ~/.ghcup/env
cabal --version
cabal update
cabal test --enable-tests --test-show-details=direct
cabal test -f-simd --enable-tests --test-show-details=direct
emulated:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
arch: ['s390x', 'ppc64le', 'armv7', 'aarch64']
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
timeout-minutes: 60
with:
arch: ${{ matrix.arch }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update -y
apt-get install -y ghc libghc-vector-dev libghc-tasty-quickcheck-dev libghc-tasty-hunit-dev
run: |
ghc --version
echo "#define BOUNDS_CHECK(f) (\_ _ _ -> id)" > src/vector.h
echo "#define UNSAFE_CHECK(f) (\_ _ _ -> id)" >> src/vector.h
ghc --make -Isrc:test -isrc:test -o Tests test/Main.hs +RTS -s
./Tests +RTS -s
ghc --make -Isrc:test -isrc:test -DUseSIMD -o Tests cbits/bitvec_simd.c test/Main.hs +RTS -s
./Tests +RTS -s
js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-cross-0.0.8.yaml
cabal update
- name: Install JS toolchain
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..
emconfigure ghcup install ghc --set javascript-unknown-ghcjs-9.6.2
- name: Build
run: |
cabal --with-compiler=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg build
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-cross-0.0.8.yaml
cabal update
- name: Install WASM toolchain
run: |
git clone https://gitlab.haskell.org/ghc/ghc-wasm-meta.git
cd ghc-wasm-meta/
export SKIP_GHC=yes
./setup.sh
source ~/.ghc-wasm/env
cd ..
ghcup install ghc --set wasm32-wasi-9.8.0.20230927 -- --host=x86_64-linux --with-intree-gmp --with-system-libffi
- name: Build
run: |
cabal --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg build
bounds-checking:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: 'latest'
- name: Update cabal package database
run: cabal update
- uses: actions/cache@v2
name: Cache cabal stuff
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-latest
- name: Test
run: |
echo packages:. > cabal.project
echo tests:True >> cabal.project
echo "constraints:quickcheck-classes -semigroupoids -aeson -semirings" >> cabal.project
echo "constraints:vector +unsafechecks +internalchecks" >> cabal.project
# Some tests are filtered out because of
# https://gitlab.haskell.org/ghc/ghc/-/issues/23132
cabal run tests --test-show-details=direct --ghc-options='-fcheck-prim-bounds -fno-ignore-asserts' -- -p '$NF!~/cloneFromWords8/&&$NF!~/cloneToByteString/'
cabal run tests -f-simd --test-show-details=direct --ghc-options='-fcheck-prim-bounds -fno-ignore-asserts' -- -p '$NF!~/cloneFromWords8/&&$NF!~/cloneToByteString/'