Speeding up tests
This commit is contained in:
parent
8e64ad6a19
commit
51349f0d75
26
Dockerfile
26
Dockerfile
|
@ -1,18 +1,17 @@
|
||||||
FROM docker.io/debian:trixie-slim AS build
|
FROM schemers/chicken:5 AS build
|
||||||
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
|
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
build-essential \
|
gcc wget ca-certificates xz-utils make git libffi-dev unzip lbzip2 cmake \
|
||||||
ca-certificates \
|
g++ python3 locate zlib1g-dev
|
||||||
git \
|
|
||||||
make \
|
|
||||||
libffi-dev \
|
|
||||||
pandoc \
|
|
||||||
chicken-bin \
|
|
||||||
libc-dev
|
|
||||||
RUN chicken-install r7rs
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
ENV PATH=${PATH}:/opt/compile-r7rs/bin
|
||||||
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
|
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
|
||||||
RUN cd chibi-scheme && make -j 32 && make -j 32 install
|
RUN cd chibi-scheme && make DESTDIR=/opt/compile-r7rs/chibi all
|
||||||
|
RUN cd chibi-scheme && make DESTDIR=/opt/compile-r7rs/chibi install
|
||||||
|
RUN mkdir -p /opt/compile-r7rs/bin
|
||||||
|
RUN echo "#!/bin/sh" > /opt/compile-r7rs/bin/snow-chibi
|
||||||
|
RUN echo "PATH=${PATH}:/opt/compile-r7rs/chibi/usr/local/bin CHIBI_MODULE_PATH=/opt/compile-r7rs/chibi/usr/local/share/chibi:/opt/compile-r7rs/chibi/usr/local/lib/chibi LD_LIBRARY_PATH=/opt/compile-r7rs/chibi/usr/local/lib exec chibi-scheme -mchibi.snow.commands -mchibi.snow.interface -mchibi.snow.package -mchibi.snow.utils /opt/compile-r7rs/chibi/usr/local/bin/snow-chibi.scm \"\$@\"" >> /opt/compile-r7rs/bin/snow-chibi
|
||||||
|
RUN chmod +x /opt/compile-r7rs/bin/snow-chibi
|
||||||
ENV SCHEME=chicken
|
ENV SCHEME=chicken
|
||||||
RUN snow-chibi --impls=${SCHEME} --always-yes install "(foreign c)"
|
RUN snow-chibi --impls=${SCHEME} --always-yes install "(foreign c)"
|
||||||
RUN snow-chibi --impls=${SCHEME} --always-yes install "(srfi 170)"
|
RUN snow-chibi --impls=${SCHEME} --always-yes install "(srfi 170)"
|
||||||
|
@ -22,6 +21,7 @@ COPY libs libs
|
||||||
RUN make PREFIX=/opt/compile-r7rs build-static
|
RUN make PREFIX=/opt/compile-r7rs build-static
|
||||||
RUN make PREFIX=/opt/compile-r7rs install
|
RUN make PREFIX=/opt/compile-r7rs install
|
||||||
|
|
||||||
FROM docker.io/debian:trixie-slim
|
FROM debian:trixie-slim
|
||||||
COPY --from=build /opt/compile-r7rs /opt/compile-r7rs
|
COPY --from=build /opt/compile-r7rs /opt/compile-r7rs
|
||||||
ENV PATH=/opt/compile-r7rs/bin:${PATH}
|
ENV PATH=${PATH}:/opt/compile-r7rs/bin
|
||||||
|
ENV LD_LIBRARY_PATH=/opt/compile-r7rs/lib
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
ARG IMAGE=chibi:head
|
ARG IMAGE=chibi:head
|
||||||
FROM docker.io/schemers/${IMAGE}
|
FROM debian:trixie AS build
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
--download-only \
|
||||||
|
--no-install-recommends \
|
||||||
|
--no-install-suggests \
|
||||||
build-essential \
|
build-essential \
|
||||||
make \
|
make \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
git \
|
git \
|
||||||
pandoc
|
cmark
|
||||||
|
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
ENV COMPILE_R7RS=${SCHEME}
|
ENV COMPILE_R7RS=${SCHEME}
|
||||||
|
FROM schemers/${IMAGE}
|
||||||
|
COPY --from=build /var/cache/apt/archives /debs
|
||||||
|
RUN dpkg -i /debs/*.deb
|
||||||
COPY --from=local-build-compile-r7rs /opt/compile-r7rs /opt/compile-r7rs
|
COPY --from=local-build-compile-r7rs /opt/compile-r7rs /opt/compile-r7rs
|
||||||
ENV PATH=/opt/compile-r7rs:${PATH}
|
ENV PATH=${PATH}:/opt/compile-r7rs/bin
|
||||||
|
|
|
@ -17,14 +17,20 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh "podman build -f Dockerfile --tag=local-build-compile-r7rs ."
|
sh "docker build -f Dockerfile --tag=local-build-compile-r7rs ."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Warm up cache') {
|
||||||
|
steps {
|
||||||
|
sh "docker build -f Dockerfile.test --build-arg IMAGE=chibi:head --build-arg SCHEME=chibi --tag=compile-r7rs-test-chibi ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test R6RS implementations') {
|
stage('Test R6RS implementations') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def r6rs_implementations = sh(script: 'podman run docker.io/retropikzel1/compile-r7rs bash -c "compile-r7rs --list-r6rs-schemes"', returnStdout: true).split()
|
def r6rs_implementations = sh(script: 'docker run retropikzel1/compile-r7rs bash -c "compile-r7rs --list-r6rs-schemes"', returnStdout: true).split()
|
||||||
parallel r6rs_implementations.collectEntries { SCHEME ->
|
parallel r6rs_implementations.collectEntries { SCHEME ->
|
||||||
[(SCHEME): {
|
[(SCHEME): {
|
||||||
stage("${SCHEME} R6RS") {
|
stage("${SCHEME} R6RS") {
|
||||||
|
@ -33,8 +39,8 @@ pipeline {
|
||||||
if("${SCHEME}" == "chicken") {
|
if("${SCHEME}" == "chicken") {
|
||||||
DOCKERIMG="chicken:5"
|
DOCKERIMG="chicken:5"
|
||||||
}
|
}
|
||||||
sh "podman build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} ."
|
sh "docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} ."
|
||||||
sh "podman run -v ${WORKSPACE}:/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c \"make && make install && make SCHEME=${SCHEME} test-r6rs\""
|
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c \"make && make install && make SCHEME=${SCHEME} test-r6rs\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +53,7 @@ pipeline {
|
||||||
stage('Test R7RS implementations') {
|
stage('Test R7RS implementations') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def r7rs_implementations = sh(script: 'podman run retropikzel1/compile-r7rs bash -c "compile-r7rs --list-r7rs-schemes"', returnStdout: true).split()
|
def r7rs_implementations = sh(script: 'docker run retropikzel1/compile-r7rs bash -c "compile-r7rs --list-r7rs-schemes"', returnStdout: true).split()
|
||||||
parallel r7rs_implementations.collectEntries { SCHEME ->
|
parallel r7rs_implementations.collectEntries { SCHEME ->
|
||||||
[(SCHEME): {
|
[(SCHEME): {
|
||||||
stage("${SCHEME} R7RS") {
|
stage("${SCHEME} R7RS") {
|
||||||
|
@ -56,8 +62,8 @@ pipeline {
|
||||||
if("${SCHEME}" == "chicken") {
|
if("${SCHEME}" == "chicken") {
|
||||||
DOCKERIMG="chicken:5"
|
DOCKERIMG="chicken:5"
|
||||||
}
|
}
|
||||||
sh "podman build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} ."
|
sh "docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} ."
|
||||||
sh "podman run -v ${WORKSPACE}:/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c \"make && make install && make SCHEME=${SCHEME} test-r7rs\""
|
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c \"make && make install && make SCHEME=${SCHEME} test-r7rs\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -2,7 +2,7 @@ PREFIX=/usr/local
|
||||||
SCHEME=chibi
|
SCHEME=chibi
|
||||||
R6RSTMP=tmp/${SCHEME}-r6rs
|
R6RSTMP=tmp/${SCHEME}-r6rs
|
||||||
R7RSTMP=tmp/${SCHEME}-r7rs
|
R7RSTMP=tmp/${SCHEME}-r7rs
|
||||||
DOCKERIMG=docker.io/${SCHEME}:head
|
DOCKERIMG=${SCHEME}:head
|
||||||
ifeq "${SCHEME}" "chicken"
|
ifeq "${SCHEME}" "chicken"
|
||||||
DOCKERIMG="chicken:5"
|
DOCKERIMG="chicken:5"
|
||||||
endif
|
endif
|
||||||
|
@ -51,8 +51,10 @@ test-r6rs:
|
||||||
-cd ${R6RSTMP} && ./main > compile-r7rs-test-result.txt 2>&1
|
-cd ${R6RSTMP} && ./main > compile-r7rs-test-result.txt 2>&1
|
||||||
@grep "Test successfull" ${R6RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R6RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
@grep "Test successfull" ${R6RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R6RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
||||||
|
|
||||||
test-r6rs-docker:
|
build-local-docker:
|
||||||
docker build -f Dockerfile --tag=local-compile-r7rs .
|
docker build -f Dockerfile --tag=local-build-compile-r7rs .
|
||||||
|
|
||||||
|
test-r6rs-docker: build-local-docker
|
||||||
docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
||||||
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r6rs"
|
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r6rs"
|
||||||
|
|
||||||
|
@ -74,8 +76,7 @@ test-r7rs:
|
||||||
-cd ${R7RSTMP} && ./main > compile-r7rs-test-result.txt 2>&1
|
-cd ${R7RSTMP} && ./main > compile-r7rs-test-result.txt 2>&1
|
||||||
@grep "Test successfull" ${R7RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R7RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
@grep "Test successfull" ${R7RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R7RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
||||||
|
|
||||||
test-r7rs-docker:
|
test-r7rs-docker: build-local-docker
|
||||||
docker build -f Dockerfile --tag=local-compile-r7rs .
|
|
||||||
docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
docker build -f Dockerfile.test --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
||||||
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r7rs"
|
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r7rs"
|
||||||
|
|
||||||
|
|
|
@ -473,11 +473,8 @@
|
||||||
(command . ,(lambda (input-file output-file prepend-directories append-directories library-files r6rs?)
|
(command . ,(lambda (input-file output-file prepend-directories append-directories library-files r6rs?)
|
||||||
(apply string-append
|
(apply string-append
|
||||||
`("sash "
|
`("sash "
|
||||||
" "
|
|
||||||
,(util-getenv "COMPILE_R7RS_SAGITTARIUS")
|
,(util-getenv "COMPILE_R7RS_SAGITTARIUS")
|
||||||
" "
|
|
||||||
,(if r6rs? " -r6 " " -r7 ")
|
,(if r6rs? " -r6 " " -r7 ")
|
||||||
" "
|
|
||||||
,@(map (lambda (item)
|
,@(map (lambda (item)
|
||||||
(string-append "-L " item " "))
|
(string-append "-L " item " "))
|
||||||
prepend-directories)
|
prepend-directories)
|
||||||
|
|
Loading…
Reference in New Issue