-
Notifications
You must be signed in to change notification settings - Fork 697
/
.gitlab-ci.yml
137 lines (128 loc) · 3.36 KB
/
.gitlab-ci.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
136
137
stages:
- build
variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: "572353e0644044fe3a5465bba4342a9a0b0eb60e"
GHC_VERSION: 9.2.3
CABAL_INSTALL_VERSION: 3.6.2.0
workflow:
rules:
- if: $CI_COMMIT_TAG
when: always
# Triggered if you start it from the gitlab web ui
- if: '$CI_PIPELINE_SOURCE == "web"'
when: always
- when: never
.build:
stage: build
script:
- bash .gitlab/ci.sh
artifacts:
expire_in: 2 week
paths:
- out/*
build-linux:
extends: .build
parallel:
matrix:
- ARCH: i386
TAG: x86_64-linux
OS:
- deb9
- ARCH: x86_64
TAG: x86_64-linux
OS:
- centos7
- deb9
- fedora33
- rocky8
- ubuntu18_04
- ubuntu20_04
- deb10
- deb11
- ARCH: aarch64
TAG: aarch64-linux
OS:
- deb10
- deb11
tags:
- $TAG
image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV"
variables:
PLATFORM: "${ARCH}-linux-${OS}"
TARBALL_ARCHIVE_SUFFIX: $PLATFORM
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections"
build-linux-alpine:
extends: .build
parallel:
matrix:
- ARCH: i386
OS: [alpine3_12]
GHC_VERSION: 9.0.2
- ARCH: x86_64
OS: [alpine3_12]
tags:
- x86_64-linux
before_script:
# for cabal build
- sudo apk add --no-cache zlib zlib-dev zlib-static
image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV"
variables:
PLATFORM: "${ARCH}-linux-${OS}"
TARBALL_ARCHIVE_SUFFIX: $PLATFORM
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
build-x86_64-darwin:
extends: .build
tags:
- x86_64-darwin
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
build-aarch64-darwin:
stage: build
tags:
- aarch64-darwin-m1
before_script:
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
- arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
# C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
script: |
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
export LD=ld
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
arch -arm64 /bin/bash ./.gitlab/ci.sh
after_script:
- rm -Rf /private/tmp/.brew_tmp
variables:
MACOSX_DEPLOYMENT_TARGET: "10.7"
TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
# Update periodically.
BREW_VERSION: 4.0.5
artifacts:
expire_in: 2 week
paths:
- out/*
cache:
paths:
- .brew
build-x86_64-windows:
extends: .build
script:
- $env:CHERE_INVOKING = "yes"
- bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh"
tags:
- new-x86_64-windows
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-windows
TARBALL_EXT: zip
ADD_CABAL_ARGS: ""
retry: 2