-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
167 lines (137 loc) · 4.52 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
167 lines (137 loc) · 4.52 KB
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
165
166
167
spec:
inputs:
fpc_version:
description: 'FPC version that should be used for compiling'
default: '3.2.2'
---
stages:
- build compiler
- build
- test
# ----------------------------
# Templates for platforms
# ----------------------------
.linux-parallel: &linux-parallel
before_script:
- 'AVAILABLE_CPU_CORES=$(( $(nproc) > 6 ? 6 : $(nproc) ))'
parallel:
matrix:
- ARCH: x86_64
# PLATFORM: linux/amd64
RUNNER_TAG: saas-linux-medium-amd64
- ARCH: aarch64
# PLATFORM: linux/arm64
RUNNER_TAG: saas-linux-small-arm64
tags:
- $RUNNER_TAG
# allows to use inputs in image field
variables:
REQUIRED_FPC_COMPILER_VERSION: $[[ inputs.fpc_version ]]
# Alpine Linux builds
.alpine_linux: &alpine_linux_configuration
<<: *linux-parallel
image: freepascal/fpc:$REQUIRED_FPC_COMPILER_VERSION-alpine-3.23-minimal
# Debian builds
.debian_linux: &debian_linux_configuration
<<: *linux-parallel
image: freepascal/fpc:$REQUIRED_FPC_COMPILER_VERSION-bullseye-full
# Ubuntu builds
.ubuntu_linux: &ubuntu_linux_configuration
<<: *linux-parallel
image: freepascal/fpc:$REQUIRED_FPC_COMPILER_VERSION-jammy-full
# ----------------------------
# Setup script section
# ----------------------------
.full_cycle_of_compiler: &full_cycle_of_compiler
stage: build compiler
script:
- cd compiler
- make fullcycle -j $AVAILABLE_CPU_CORES
.creating_full_installation: &creating_full_installation
stage: build
script:
- |
MUSL_DYNAMIC_LINKER_PATH=$(find /lib/ -name "ld-musl-*.so.*" -print -quit)
if [ -n "$MUSL_DYNAMIC_LINKER_PATH" ]; then
make zipinstall -j $AVAILABLE_CPU_CORES OS_TARGET=linux CPU_TARGET=$ARCH FPMAKEOPT="-T $AVAILABLE_CPU_CORES" OPT="-FL$MUSL_DYNAMIC_LINKER_PATH"
else
make zipinstall -j $AVAILABLE_CPU_CORES OS_TARGET=linux CPU_TARGET=$ARCH FPMAKEOPT="-T $AVAILABLE_CPU_CORES"
fi
artifacts:
when: on_success
expire_in: 1 week
paths:
- fpc-*.tar.gz
.run_tests: &run_tests
stage: test
script:
- |
MUSL_DYNAMIC_LINKER_PATH=$(find /lib/ -name "ld-musl-*.so.*" -print -quit)
if [ -n "$MUSL_DYNAMIC_LINKER_PATH" ]; then
make all -j $AVAILABLE_CPU_CORES OS_TARGET=linux CPU_TARGET=$ARCH FPMAKEOPT="-T $AVAILABLE_CPU_CORES" OPT="-FL$MUSL_DYNAMIC_LINKER_PATH"
else
make all -j $AVAILABLE_CPU_CORES OS_TARGET=linux CPU_TARGET=$ARCH FPMAKEOPT="-T $AVAILABLE_CPU_CORES"
fi
- FPC_SRC=$(pwd)
- |
case "$ARCH" in
x86_64)
COMPILER_EXE_NAME="ppcx64"
;;
aarch64)
COMPILER_EXE_NAME="ppca64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
- FPC_COMPILER=$(find $FPC_SRC/compiler/ -name $COMPILER_EXE_NAME)
# run tests
- cd tests
- make clean -j $AVAILABLE_CPU_CORES TEST_FPC=$FPC_COMPILER TEST_DELTEMP=1
- make full -j $AVAILABLE_CPU_CORES TEST_FPC=$FPC_COMPILER TEST_DELTEMP=1
# generate junit test report
- cd utils
- make fpts2junit
- cd $FPC_SRC
- tests/utils/fpts2junit $FPC_SRC/tests/output/*/ testresult.xml
artifacts:
when: always
reports:
junit: testresult.xml
# ----------------------------
# Build compiler section (fail fast before building everything)
# ----------------------------
Full Cycle of Compiler on Alpine Linux:
<<: [*full_cycle_of_compiler, *alpine_linux_configuration]
Full Cycle of Compiler on Debian Linux:
<<: [*full_cycle_of_compiler, *debian_linux_configuration]
Full Cycle of Compiler on Ubuntu Linux:
<<: [*full_cycle_of_compiler, *ubuntu_linux_configuration]
# ----------------------------
# Build section
# ----------------------------
Build FPC on Alpine Linux:
<<: [*creating_full_installation, *alpine_linux_configuration]
Build FPC on Debian Linux:
<<: [*creating_full_installation, *debian_linux_configuration]
Build FPC on Ubuntu Linux:
<<: [*creating_full_installation, *ubuntu_linux_configuration]
# ----------------------------
# Testing section
# ----------------------------
Run FPC Tests on Alpine Linux:
<<: [*run_tests, *alpine_linux_configuration]
dependencies: []
timeout: 2h
# TODO: package gdbint can't be compiled because musl does not provide libgdb.a
allow_failure: true
Run FPC Tests on Debian Linux:
<<: [*run_tests, *debian_linux_configuration]
dependencies: []
timeout: 2h
Run FPC Tests on Ubuntu Linux:
<<: [*run_tests, *ubuntu_linux_configuration]
dependencies: []
timeout: 2h