aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2021-10-03 00:03:46 +0200
committereine <eine@users.noreply.github.com>2021-10-03 01:31:26 +0200
commit794e12824339a440b6037a53c879e19695b08698 (patch)
tree47a3ef0627a96c8d3c91a80137cc13bd486f9425
parent4a97a705a0606b7a8b5f36dd259a40989c18c821 (diff)
downloadghdl-yosys-plugin-794e12824339a440b6037a53c879e19695b08698.tar.gz
ghdl-yosys-plugin-794e12824339a440b6037a53c879e19695b08698.tar.bz2
ghdl-yosys-plugin-794e12824339a440b6037a53c879e19695b08698.zip
ci/synth: use yosys container from hdl/containers
-rwxr-xr-xci.sh34
1 files changed, 27 insertions, 7 deletions
diff --git a/ci.sh b/ci.sh
index a1cd8d1..a3d1471 100755
--- a/ci.sh
+++ b/ci.sh
@@ -26,17 +26,37 @@ do_plugin () {
gstart "[Build] ghdl/synth:beta" "$ANSI_MAGENTA"
docker build -t ghdl/synth:beta . -f- <<-EOF
-FROM ghdl/cache:yosys-gnat AS build
-COPY --from=ghdl/pkg:buster-mcode / /opt/ghdl
+ARG REGISTRY='gcr.io/hdl-containers/debian/bullseye'
+
+#---
+
+# WORKAROUND: this is required because 'COPY --from' does not support ARGs
+FROM \$REGISTRY/pkg/ghdl AS pkg-ghdl
+
+FROM \$REGISTRY/yosys AS base
+
+RUN apt-get update -qq \
+ && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
+ libgnat-9 \
+ && apt-get autoclean && apt-get clean && apt-get -y autoremove \
+ && rm -rf /var/lib/apt/lists
+
+COPY --from=pkg-ghdl /ghdl /
+
+#---
+
+FROM base AS build
+
COPY . /ghdlsynth
-RUN cp -vr /opt/ghdl/* /usr/local \
- && cd /ghdlsynth \
+RUN cd /ghdlsynth \
&& make \
- && cp ghdl.so /opt/ghdl/lib/ghdl_yosys.so
+ && cp ghdl.so /tmp/ghdl_yosys.so
+
+#---
-FROM ghdl/cache:yosys-gnat
-COPY --from=build /opt/ghdl /usr/local
+FROM base
+COPY --from=build /tmp/ghdl_yosys.so /usr/local/lib/
RUN yosys-config --exec mkdir -p --datdir/plugins \
&& yosys-config --exec ln -s /usr/local/lib/ghdl_yosys.so --datdir/plugins/ghdl.so
EOF