CI: added Pas2JS compiler to build image and Codetools test job (manual for now)

(cherry picked from commit 8b17a65191)
This commit is contained in:
Maxim Ganetsky 2023-07-19 18:46:48 +03:00
parent a50f2017b9
commit c0e2e8f5c5
2 changed files with 45 additions and 0 deletions

View File

@ -311,3 +311,22 @@ docs-fpdoc-stable:
FOOTER: "locallclfooter.xml"
rules:
- !reference [.manualjob, rules]
tests-codetools: # run Codetools tests and output results in JUnit format (for this FPC 3.3.1 and up is needed)
stage: build
variables:
OUTPUT_FILE: testresults_codetools.xml
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64
- cd components/codetools/tests
- $CI_PROJECT_DIR/lazbuild --compiler=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64 --lazarusdir=$CI_PROJECT_DIR runtestscodetools.lpi
- FPCDIR=/fpcsrc/$FPC_MAIN_VER ./runtestscodetools --all --format=junit --file=$CI_PROJECT_DIR/$OUTPUT_FILE
artifacts:
when: always
paths:
- $OUTPUT_FILE
reports:
junit: $OUTPUT_FILE
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]

View File

@ -6,6 +6,7 @@ ARG FPC_MAIN_VER
RUN dpkg --add-architecture i386 && apt-get update && apt-get -y install \
build-essential \
git \
libc6-dev-i386 \
libgtk2.0-dev \
libgtk-3-dev \
@ -87,6 +88,31 @@ RUN tarballs=( \
fi; \
cd ..; \
done; \
# save sources for FPC from main branch separately (they are needed e.g. for running Codetools tests)
fpcsrcdir=/fpcsrc; \
fpcsrcdirmain=$fpcsrcdir/$FPC_MAIN_VER; \
mkdir -p $fpcsrcdirmain; \
tar zxf source-main.tar.gz --strip-components=1 --directory $fpcsrcdirmain; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
# compile and install pas2js (needed for running some Codetools tests)
git clone --depth 1 https://gitlab.com/freepascal.org/fpc/pas2js.git; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
cd pas2js; \
rm -rf compiler; \
ln -s ../source-main compiler; \
make all FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64; \
make install FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
cd ..; \
rm -rf pas2js; \
echo "Contents of /usr/local/bin/pas2js.cfg:"; \
cat /usr/local/bin/pas2js.cfg; \
# remove sources
for tbl in "${tarballs[@]}"; do \
tarball=($tbl); \