-
Notifications
You must be signed in to change notification settings - Fork 110
138 lines (116 loc) · 3.92 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
name: ci
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
ghc: ['8.0', '8.2', '8.4', '8.6', '8.8', '8.10', '9.0', '9.2', '9.4', '9.6', '9.8']
include:
- os: macOS-latest
ghc: 'latest'
- os: windows-latest
ghc: 'latest'
steps:
- uses: actions/checkout@v4
- name: Install prerequisites for GHC <= 8.2 on ubuntu-22.04
if: runner.os == 'Linux' && matrix.ghc <= '8.2'
run: |
sudo apt-get install libncurses5 libtinfo5
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-update: true
- uses: actions/cache/restore@v4
name: Restore cabal cache
id: cache
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-commit-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-
- name: Test
run: |
set -e
cabal build all
cabal install ./core-tests
export PATH="${HOME}/.cabal/bin:${PATH}"
(cd core-tests && tasty-core-tests +RTS -N2)
core-tests/exit-status-tests.sh
# Prevent Git for Windows from replacing slashes with backslashes in patterns
MSYS_NO_PATHCONV=1 core-tests/failing-pattern-test.sh
core-tests/multiple-pattern-test.sh
- name: Test resource-release-test.sh
if: runner.os != 'Windows'
run: |
export PATH="${HOME}/.cabal/bin:${PATH}"
core-tests/resource-release-test.sh
- name: Haddock
if: matrix.ghc != '8.0' && matrix.ghc != '8.2' && matrix.ghc != '8.4'
run: cabal haddock all
- name: Save cache
if: always()
uses: actions/cache/save@v4
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ steps.cache.outputs.cache-primary-key }}
build-wasi:
runs-on: ubuntu-latest
env:
GHC_WASM_META_REV: 895f7067e1d4c918a45559da9d2d6a403a690703
FLAVOUR: '9.6'
steps:
- name: Setup ghc-wasm32-wasi
run: |
cd "$(mktemp -d)"
curl -L "https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/${GHC_WASM_META_REV}/ghc-wasm-meta-master.tar.gz" | tar xz --strip-components=1
./setup.sh
~/.ghc-wasm/add_to_github_path.sh
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
id: cache
with:
path: |
~/.ghc-wasm/.cabal/store
dist-newstyle
key: build-wasi-${{ runner.os }}-wasm-meta-${{ env.GHC_WASM_META_REV }}-flavour-${{ env.FLAVOUR }}-${{ github.sha }}
restore-keys: |
build-wasi-${{ runner.os }}-wasm-meta-${{ env.GHC_WASM_META_REV }}-flavour-${{ env.FLAVOUR }}-
- name: Build
run: |
wasm32-wasi-cabal build all
TEST_WRAPPERS="$(mktemp -d)"
echo "${TEST_WRAPPERS}" >> "${GITHUB_PATH}"
wasm32-wasi-cabal install ./core-tests
for test in tasty-core-tests exit-status-test resource-release-test failing-pattern-test; do
echo '#!/usr/bin/env bash' > "${TEST_WRAPPERS}/${test}"
echo "wasmtime --mapdir /::/ --env PWD=\"\$PWD\" ~/.ghc-wasm/.cabal/bin/$test.wasm -- \"\$@\"" \
>> "${TEST_WRAPPERS}/${test}"
chmod +x "${TEST_WRAPPERS}/${test}"
done
- name: Test
run: |
(cd core-tests && tasty-core-tests)
core-tests/exit-status-tests.sh
core-tests/failing-pattern-test.sh
- uses: actions/cache/save@v4
if: always()
with:
path: |
~/.ghc-wasm/.cabal/store
dist-newstyle
key: ${{ steps.cache.outputs.cache-primary-key }}