-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (100 loc) · 3.53 KB
/
build.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
name: Build and Test
on:
push:
paths-ignore:
- '**.md'
# only one build per branch
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
ghc: ['9.10.1']
cabal: ['3.10.3.0']
steps:
- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
# - name: Install MSYS for Windors
# if: runner.os == 'Windows'
# uses: msys2/setup-msys2@v2
# - name: Setup - PostgreSQL
# id: postgres-setup
# uses: ikalnytskyi/action-setup-postgres@v7
# with:
# postgres-version: "16"
# database: 'postgres'
# username: 'postgres'
# password: 'postgres'
- name: Setup - MySQL
id: mysql-setup
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "9.0.1"
- name: Setup - GHC ${{ matrix.ghc }}
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
# Defaults, added for clarity:
cabal-version: ${{ matrix.cabal }}
cabal-update: true
# - name: Setup Haskell
# if: runner.os == 'Windows'
# run: |
# ghcup install ghc --set ${{ matrix.ghc }}
# ghcup install cabal --set ${{ matrix.cabal }}
# ghc --version
# cabal --version
# cabal update
- name: Install system dependencies - Windows
if: runner.os == 'Windows'
run: |
# ghcup should be installed on current GHA Windows runners. Let's use ghcup to run
# pacman, to install the necessary dependencies, ...
ghcup run --mingw-path -- pacman --noconfirm -S `
mingw-w64-x86_64-pkg-config `
mingw-w64-x86_64-pcre `
mingw-w64-x86_64-libsodium `
mingw-w64-x86_64-libmariadbclient `
base-devel `
autoconf-wrapper `
autoconf `
automake `
libtool `
make
$ghcMingwDir = Join-Path -Path $(ghc --print-libdir) `
-ChildPath ../mingw/x86_64-*-mingw32/lib/ `
-Resolve
cabal user-config -a "extra-prog-path: C:/msys64/mingw64/bin, C:/msys64/usr/bin" `
-a "extra-include-dirs: C:/msys64/mingw64/include, /mingw64/include/mysql, \mingw64\include\mysql" `
-a ("extra-lib-dirs: {0}, C:/msys64/mingw64/lib" -f $ghcMingwDir) `
-f init
- name: Build - MySQL
run: cabal build mysql
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- name: Build - All dependencies
run: cabal build all --only-dependencies
- name: Build
run: cabal build all --extra-include-dirs=/opt/homebrew/include
- name: Test
env:
PGSERVICE: ${{ steps.postgres-setup.outputs.service-name }}
MYSQL_STUFF: ${{ steps.mysql.outputs.base-dir }}
run: |
set -x
export MYSQL_UNIX_PORT=$(dirname $MYSQL_HOME)/tmp/mysql.sock
cabal run emulator-tests
# We run this only when a PR is merged so we can see how things are performing
# on the GH actions machines.
- name: Benchmark
if: github.ref == 'refs/heads/main'
run: cabal run emulator-tests