-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (116 loc) · 4.11 KB
/
haskell.yml
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
name: Haskell CI
on:
push:
branches: [ "main" ]
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Build and test
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7", "9.2.8", "9.4.8", "9.6.5", "9.8.2", "9.10.1"]
cabal: ["3.10.3.0"]
os: [ubuntu-latest] # ubuntu-latest = ubuntu-22.04
liburing: ["liburing-2.6"]
include:
- ghc: "9.6.5"
cabal: "3.10.3.0"
os: ubuntu-20.04
liburing: "liburing-2.1"
# It's weird, but at the liburing-2.1 tag, the liburing.pc file lists
# a library version 2.0. From liburing-2.2 onward, the version listed
# in the liburing.pc file is no longer a mismatch.
- ghc: "9.6.5"
cabal: "3.10.3.0"
os: ubuntu-20.04
liburing: "liburing-2.6"
- ghc: "9.6.5"
cabal: "3.10.3.0"
os: ubuntu-22.04
liburing: "liburing-2.1"
- ghc: "9.6.5"
cabal: "3.10.3.0"
os: ubuntu-22.04
liburing: "system"
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true
- name: Install (specific) liburing from source
id: setup-liburing-source
if: ${{ ! (matrix.liburing == 'system') }}
run: |
sudo apt-get update
sudo apt-get -y install pkg-config
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
mkdir tmp
cd tmp
git clone https://github.com/axboe/liburing.git
cd liburing
git checkout ${{ matrix.liburing }}
./configure --cc=gcc --cxx=g++
make -j$(nproc)
sudo make install
cd ../..
sudo rm -rf ./tmp
pkg-config --modversion liburing
- name: Install (newest) liburing from a package manager
id: setup-liburing-cloned
if: ${{ matrix.liburing == 'system' }}
run: |
sudo apt-get update
sudo apt-get -y install pkg-config liburing-dev
- name: Configure the build
run: |
cabal configure --enable-test --enable-benchmark --ghc-options="-Werror" --ghc-options="-fno-ignore-asserts"
cat cabal.project.local
- name: Record cabal dependencies
id: record-deps
run: |
cabal build all --dry-run
- name: "Restore cache"
uses: actions/cache/restore@v4
id: restore-cabal-cache
env:
cache-name: cache-cabal-build
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.liburing }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.liburing }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.liburing }}-${{ env.cache-name }}-
- name: Install cabal dependencies
id: build-dependencies
run: cabal build --only-dependencies --enable-tests --enable-benchmarks all
- name: "Save cache"
uses: actions/cache/save@v4
id: save-cabal-cache
# Note: cache-hit will be set to true only when cache hit occurs for the
# exact key match. For a partial key match via restore-keys or a cache
# miss, it will be set to false.
if: steps.build-dependencies.outcome == 'success' && steps.restore-cabal-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ steps.restore-cabal-cache.outputs.cache-primary-key }}
- name: Build
run: cabal build all
- name: Set test timeout
run: |
echo "TASTY_TIMEOUT=5m" >> "$GITHUB_ENV"
- name: Run tests
run: cabal test -j1 --test-show-details=direct all