forked from mp-17/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
143 lines (128 loc) · 3.92 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
# Copyright 2021 ETH Zurich and University of Bologna.
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Author: Noah Huetter <[email protected]>, ETH Zurich
########################################
## Environment
########################################
# Variables must coincide with Memora.yml
variables:
WORK: ${CI_PROJECT_DIR}/.gitlab-ci.d/work
SRC: ${CI_PROJECT_DIR}
NEWLIB_VERS: 3.3.0
TRIPLE: riscv32-iis-llvm
LLVM_VERSION: 12.0.1
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never # avoid duplicate branch and merge request pipelines
- if: '$CI_COMMIT_BRANCH'
stages:
- tools
- build
- test
- package
- deploy
########################################
## Build stage
########################################
tc-llvm:
stage: build
needs: []
script:
- |
if ! $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup tc-llvm; then
make -C ${CI_PROJECT_DIR}/.gitlab-ci.d tc-llvm
make -C ${CI_PROJECT_DIR}/.gitlab-ci.d tc-llvm-newlib
make -C ${CI_PROJECT_DIR}/.gitlab-ci.d tc-llvm-crt
$CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert tc-llvm
fi
# Build most recent banshee and upload as artifact
banshee:
stage: build
needs: []
before_script:
- |
- rustup toolchain install 1.50.0
- rustup override set 1.50.0
- rustc --version
- cargo --version
- export CC=gcc-9.2.0
- export CXX=g++-9.2.0
- export LLVM_SYS_100_PREFIX=/usr/pack/llvm-10.0.1-af
- export LLVM_SYS_120_PREFIX=/usr/pack/llvm-12.0.1-af
- export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/pack/gcc-9.2.0-af/linux-x64/bin/gcc
- git clone --depth 1 [email protected]:pulp-platform/snitch.git ${WORK}/snitch
script:
- cd ${WORK}/snitch/sw/banshee
- cargo build
- cargo install --debug --path . --root ${WORK}/install
artifacts:
paths:
- ${WORK}/install/bin/banshee
########################################
## Test stage
########################################
# Runs a test discovery on newly added regression tests and runs them
# Re-build entire LLVM
llvm-new:
stage: test
needs: []
before_script:
- make -C ${CI_PROJECT_DIR}/.gitlab-ci.d tc-llvm
script:
- make -C ${CI_PROJECT_DIR}/.gitlab-ci.d LLVM_BASE=llvmorg-${LLVM_VERSION} test-llvm-new
# Use the built TC to build the snitch runtime and test it on banshee
snitch-runtime-banshee:
stage: test
needs:
- banshee
- tc-llvm
dependencies:
- banshee
before_script:
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
- git clone --depth 1 [email protected]:pulp-platform/snitch.git ${WORK}/snitch
script:
- cd ${WORK}/snitch/sw/snRuntime
- mkdir build; cd build
- export PATH=${WORK}/install/bin:${PATH}
- cmake-3.18.1 -DCMAKE_TOOLCHAIN_FILE=toolchain-llvm -DBUILD_TESTS=ON ..
- make -j`nproc`
- ctest -j`nproc`
hero:
stage: test
needs: []
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
trigger:
project: hero/hero
strategy: depend
allow_failure: true
inherit:
variables: false
variables:
DOWNSTREAM: "true"
SUBMODULE_NAME: $CI_PROJECT_NAME
SUBMODULE_COMMIT_SHA: $CI_COMMIT_SHA
########################################
## Package stage
########################################
dist:
stage: package
needs:
- tc-llvm
before_script:
- export PKGVERS=${TRIPLE}-centos7-${LLVM_VERSION}-$(git rev-parse --short HEAD)
- echo ${PKGVERS}
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
script:
- tar -czf ${PKGVERS}.tar.gz --transform s/^install/${PKGVERS}/ ${WORK}/install
artifacts:
paths:
- "*.tar.gz"
########################################
## Deploy stage
########################################