forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
161 lines (148 loc) · 4.9 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: "853f348f9caf38b08740b280296fbd34e09abb3a"
GHC_VERSION: 8.10.7
CABAL_INSTALL_VERSION: 3.6.2.0
workflow:
rules:
- if: $CI_COMMIT_TAG
when: always
- if: '$CI_PIPELINE_SOURCE == "web"'
when: always
- when: never
.build:
script:
- bash .gitlab/ci.sh
artifacts:
expire_in: 2 week
paths:
- out/*
build-aarch64-linux-deb10:
extends: .build
tags:
- aarch64-linux
image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV"
variables:
TARBALL_ARCHIVE_SUFFIX: aarch64-linux-deb10
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
build-armv7-linux-deb10:
extends: .build
tags:
- armv7-linux
image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV"
variables:
TARBALL_ARCHIVE_SUFFIX: armv7-linux-deb1
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
# temp, because 3.6.2.0 is broken
CABAL_INSTALL_VERSION: 3.4.0.0
retry: 2
build-x86_64-linux:
extends: .build
tags:
- x86_64-linux
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV"
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-linux-deb10
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections"
build-x86_64-linux-alpine:
extends: .build
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/x86_64-linux-alpine3_12:$DOCKER_REV"
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-linux-alpine
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
build-i386-linux-alpine:
extends: .build
tags:
- x86_64-linux
image: "i386/alpine:3.12"
before_script:
# for GHC
- apk add --no-cache bash curl gcc g++ binutils binutils-gold bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl
# for cabal build
- apk add --no-cache zlib zlib-dev zlib-static
variables:
TARBALL_ARCHIVE_SUFFIX: i386-linux-alpine
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
# temp, because 3.6.2.0 is broken
CABAL_INSTALL_VERSION: 3.4.0.0
build-x86_64-freebsd13:
extends: .build
tags:
- x86_64-freebsd13
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd13
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections"
build-x86_64-freebsd12:
extends: .build
tags:
- x86_64-freebsd12
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd12
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections"
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:
tags:
- aarch64-darwin-m1
script: |
set -Eeuo pipefail
function runInNixShell() {
time nix-shell $CI_PROJECT_DIR/.gitlab/shell.nix \
-I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
--argstr system "aarch64-darwin" \
--pure \
--keep CI_PROJECT_DIR \
--keep MACOSX_DEPLOYMENT_TARGET \
--keep GHC_VERSION \
--keep CABAL_INSTALL_VERSION \
--keep TARBALL_ARCHIVE_SUFFIX \
--keep TARBALL_EXT \
--keep ADD_CABAL_ARGS \
--run "$1" 2>&1
}
runInNixShell "./.gitlab/ci.sh" 2>&1
variables:
MACOSX_DEPLOYMENT_TARGET: "10.7"
TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
artifacts:
expire_in: 2 week
paths:
- out/*
build-x86_64-windows:
extends: .build
script:
- Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $false, $true, $true, $false, $false, $false, $false, "$CI_PROJECT_DIR"
- ./ghcup/msys64/usr/bin/bash '-lc' 'pacman --noconfirm -S zip'
- $env:CHERE_INVOKING = "yes"
- ./ghcup/msys64/usr/bin/bash '-lc' "TARBALL_ARCHIVE_SUFFIX=$env:TARBALL_ARCHIVE_SUFFIX TARBALL_EXT=$env:TARBALL_EXT ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh"
after_script:
- "[Environment]::SetEnvironmentVariable('GHCUP_INSTALL_BASE_PREFIX', $null, [System.EnvironmentVariableTarget]::User)"
- "[Environment]::SetEnvironmentVariable('GHCUP_MSYS2', $null, [System.EnvironmentVariableTarget]::User)"
- "[Environment]::SetEnvironmentVariable('CABAL_DIR', $null, [System.EnvironmentVariableTarget]::User)"
tags:
- new-x86_64-windows
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-windows
TARBALL_EXT: zip
ADD_CABAL_ARGS: ""
retry: 2