-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy path.gitlab-ci.yml
164 lines (140 loc) · 3.87 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
162
163
164
include:
- '/.ci/gitlab/common.yml'
- '/.ci/gitlab/publish.yml'
# - '/.ci/gitlab/benchmark.yml'
variables:
# Default GHC / Cabal version. Used for generating Haddock and releasing to
# Hackage.
GHC_VERSION: 8.10.7
# https://docs.gitlab.com/runner/executors/custom.html#system-failure
GET_SOURCES_ATTEMPTS: 5
RESTORE_CACHE_ATTEMPTS: 5
ARTIFACT_DOWNLOAD_ATTEMPTS: 5
# We test all GHC version we support, so there is no use to fail if Clash
# detects a known-to-be-broken compiler.
CLASH_IGNORE_BROKEN_GHCS: "True"
stages:
- pre
- test
- pack
- publish
- post
tests:
stage: test
needs: []
trigger:
include: .ci/gitlab/test.yml
strategy: depend
variables:
CI_PARENT_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
parallel:
matrix:
- GHC_VERSION: 9.10.1
RUN_TESTS: "always"
- GHC_VERSION: 9.8.4
# TODO: remove this when https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
SKIP_CLASH_FFI_EXAMPLE: "yes"
RUN_TESTS: "always"
- GHC_VERSION: 9.6.6
RUN_TESTS: "always"
- GHC_VERSION: [9.4.8, 9.2.8]
RUN_TESTS: "nightly"
- GHC_VERSION: 9.0.2
WORKAROUND_GHC_MMAP_CRASH: "yes"
RUN_TESTS: "always"
- GHC_VERSION: [8.10.7]
WORKAROUND_GHC_MMAP_CRASH: "yes"
RUN_TESTS: "always"
stack-build:
extends: .common-local
image: fpco/stack-build:lts-22.33
needs: []
stage: test
variables:
CACHE_FALLBACK_KEY: $CI_JOB_NAME-master-$CI_JOB_IMAGE-$CACHE_BUST_TOKEN-3-non_protected
before_script:
- apt-get update
- apt-get install -y zstd
- export THREADS=$(./.ci/effective_cpus.sh)
- export
- tar -xf cache.tar.zst -C / || true
# Print stack.yaml for debugging
- cat stack.yaml
script:
# Note: the --pedantic switch adds -Wall -Werror to the options passed to
# GHC. Options specified in stack.yaml (like -Wcompat) are still passed; it
# is cumulative. Future versions of Stack might add behavior to --pedantic.
- stack build -j$THREADS --pedantic
after_script:
- export THREADS=$(./.ci/effective_cpus.sh)
- tar -cf - /root/.stack | zstd -T$THREADS -3 > cache.tar.zst
nix-build:
image: nixos/nix:2.10.1
needs: []
stage: test
before_script:
- nix-env -i gawk
script:
- nix-build -j$(./.ci/effective_cpus.sh) --log-format raw --max-silent-time 3600
tags:
- local
haddock:
extends: .common-local
needs: []
stage: test
variables:
GHC_VERSION: 9.0.2
artifacts:
paths:
- hadocs/*/*
expire_in: 1 month
script:
- .ci/build_docs.sh
# # Run benchmarks for isclashfastyet.com
# benchmark-8.10.2:
# extends: .benchmark
# "Publish" a release candidate
hackage-release-candidate:
extends: .hackage
variables:
HACKAGE_RELEASE: "no"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "trigger"
# Release new version of Clash to Hackage
hackage-release:
extends: .hackage
variables:
HACKAGE_RELEASE: "yes"
rules:
- if: '$CI_COMMIT_TAG != null' # tags
# We manually report status to GitHub to work around
# <https://gitlab.com/gitlab-org/gitlab/-/issues/216629>.
# The script will also send a Slack message when the nightly fails.
#
# If we ever remove this manual GitHub reporting, we may have to rethink the
# use of the interruptible flag: see <https://github.com/clash-lang/clash-compiler/pull/2616#discussion_r1409429185>
.report_status:
# interruptible: false
image: curlimages/curl
dependencies: []
variables:
GIT_SUBMODULE_STRATEGY: recursive
set_pending:
extends: .report_status
stage: pre
script:
- .ci/report_status.sh pending
set_success:
extends: .report_status
stage: post
when: on_success
script:
- .ci/report_status.sh success
set_failure:
extends: .report_status
stage: post
when: on_failure
script:
- .ci/report_status.sh failure