From adbdb9496e0b1e8c3869f85c3abc045f30d20cf7 Mon Sep 17 00:00:00 2001
From: Axel Heider <axelheider@gmx.de>
Date: Tue, 9 Jan 2024 13:58:53 +0100
Subject: [PATCH] WIP: CI docker hack to see changes

---
 camkes-vm/Dockerfile        | 39 ++++++++++--------------------------
 camkes-vm/action.yml        |  2 +-
 camkes-vm/seL4-platforms    |  1 +
 sel4test-hw/Dockerfile      | 39 ++++++++++--------------------------
 sel4test-hw/action.yml      |  2 +-
 sel4test-hw/seL4-platforms  |  1 +
 sel4test-sim/Dockerfile     | 40 ++++++++++---------------------------
 sel4test-sim/action.yml     |  2 +-
 sel4test-sim/seL4-platforms |  1 +
 9 files changed, 36 insertions(+), 91 deletions(-)
 create mode 120000 camkes-vm/seL4-platforms
 create mode 120000 sel4test-hw/seL4-platforms
 create mode 120000 sel4test-sim/seL4-platforms

diff --git a/camkes-vm/Dockerfile b/camkes-vm/Dockerfile
index 013a78e2..9a1c5f1e 100644
--- a/camkes-vm/Dockerfile
+++ b/camkes-vm/Dockerfile
@@ -2,39 +2,20 @@
 #
 # SPDX-License-Identifier: BSD-2-Clause
 
-# The context of this Dockerfiles is the repo root (../)
+FROM sel4/camkes-vm:latest
 
-ARG WORKSPACE=/workspace
-ARG SCRIPTS=/ci-scripts
-ARG ACTION=camkes-vm
+WORKDIR ci-scripts
+COPY steps.sh ./
+RUN chmod a+rx ./*
 
-FROM trustworthysystems/camkes:latest
-
-RUN apt-get update \
-    && apt-get install -y --no-install-recommends \
-       libffi-dev \
-    && apt-get clean autoclean \
-    && apt-get autoremove --yes \
-    && rm -rf /var/lib/{apt,dpkg,cache,log}/
-RUN pip3 install junitparser PyGithub
-
-ARG ACTION
-ARG SCRIPTS
-RUN mkdir ${SCRIPTS}
-COPY ${ACTION}/steps.sh scripts/* ${SCRIPTS}/
-RUN chmod a+rx ${SCRIPTS}/*
-ENV  PATH "${SCRIPTS}:${PATH}"
-
-RUN mkdir /builds
-COPY ${ACTION}/builds.yml \
-     ${ACTION}/build.py \
+WORKDIR /builds
+COPY builds.yml \
+     build.py \
      seL4-platforms/platforms.yml \
      seL4-platforms/platforms.py \
      seL4-platforms/builds.py \
-     /builds/
+     ./
 
-ARG WORKSPACE
-RUN mkdir -p ${WORKSPACE}
-WORKDIR ${WORKSPACE}
+WORKDIR /workspace
 
-ENTRYPOINT steps.sh
+ENTRYPOINT /ci-scripts/steps.sh
diff --git a/camkes-vm/action.yml b/camkes-vm/action.yml
index 4c069fab..3b705f15 100644
--- a/camkes-vm/action.yml
+++ b/camkes-vm/action.yml
@@ -20,4 +20,4 @@ inputs:
 
 runs:
   using: 'docker'
-  image: 'docker://sel4/camkes-vm:latest'
+  image: 'Dockerfile'
diff --git a/camkes-vm/seL4-platforms b/camkes-vm/seL4-platforms
new file mode 120000
index 00000000..f24c9c72
--- /dev/null
+++ b/camkes-vm/seL4-platforms
@@ -0,0 +1 @@
+../seL4-platforms
\ No newline at end of file
diff --git a/sel4test-hw/Dockerfile b/sel4test-hw/Dockerfile
index 42092bac..2187f56a 100644
--- a/sel4test-hw/Dockerfile
+++ b/sel4test-hw/Dockerfile
@@ -2,39 +2,20 @@
 #
 # SPDX-License-Identifier: BSD-2-Clause
 
-# The context of this Dockerfiles is the repo root (../)
+FROM sel4/sel4test-hw:latest
 
-ARG WORKSPACE=/workspace
-ARG SCRIPTS=/ci-scripts
-ARG ACTION=sel4test-hw
+WORKDIR ci-scripts
+COPY steps.sh ./
+RUN chmod a+rx ./*
 
-FROM trustworthysystems/sel4:latest
-
-RUN apt-get update \
-    && apt-get install -y --no-install-recommends \
-       libffi-dev \
-    && apt-get clean autoclean \
-    && apt-get autoremove --yes \
-    && rm -rf /var/lib/{apt,dpkg,cache,log}/
-RUN pip3 install junitparser PyGithub
-
-ARG SCRIPTS
-ARG ACTION
-RUN mkdir ${SCRIPTS}
-COPY ${ACTION}/steps.sh scripts/* ${SCRIPTS}/
-RUN chmod a+rx ${SCRIPTS}/*
-ENV  PATH "${SCRIPTS}:${PATH}"
-
-RUN mkdir /builds
-COPY ${ACTION}/builds.yml \
-     ${ACTION}/build.py \
+WORKDIR /builds
+COPY builds.yml \
+     build.py \
      seL4-platforms/platforms.yml \
      seL4-platforms/platforms.py \
      seL4-platforms/builds.py \
-     /builds/
+     ./
 
-ARG WORKSPACE
-RUN mkdir -p ${WORKSPACE}
-WORKDIR ${WORKSPACE}
+WORKDIR /workspace
 
-ENTRYPOINT steps.sh
+ENTRYPOINT /ci-scripts/steps.sh
diff --git a/sel4test-hw/action.yml b/sel4test-hw/action.yml
index 1b63d27e..c1bad0af 100644
--- a/sel4test-hw/action.yml
+++ b/sel4test-hw/action.yml
@@ -38,4 +38,4 @@ inputs:
 
 runs:
   using: 'docker'
-  image: 'docker://sel4/sel4test-hw:latest'
+  image: 'Dockerfile'
diff --git a/sel4test-hw/seL4-platforms b/sel4test-hw/seL4-platforms
new file mode 120000
index 00000000..f24c9c72
--- /dev/null
+++ b/sel4test-hw/seL4-platforms
@@ -0,0 +1 @@
+../seL4-platforms
\ No newline at end of file
diff --git a/sel4test-sim/Dockerfile b/sel4test-sim/Dockerfile
index a67e0990..4e50b545 100644
--- a/sel4test-sim/Dockerfile
+++ b/sel4test-sim/Dockerfile
@@ -2,39 +2,19 @@
 #
 # SPDX-License-Identifier: BSD-2-Clause
 
-# The context of this Dockerfiles is the repo root (../)
+FROM sel4/sel4test-sim:latest
 
-ARG WORKSPACE=/workspace
-ARG SCRIPTS=/ci-scripts
-ARG ACTION=sel4test-sim
+WORKDIR /ci-scripts
+COPY steps.sh ./
+RUN chmod a+rx ./*
 
-FROM trustworthysystems/sel4:latest
-
-RUN apt-get update \
-    && apt-get install -y --no-install-recommends \
-       libffi-dev \
-    && apt-get clean autoclean \
-    && apt-get autoremove --yes \
-    && rm -rf /var/lib/{apt,dpkg,cache,log}/
-RUN pip3 install junitparser PyGithub
-
-ARG SCRIPTS
-ARG ACTION
-RUN mkdir ${SCRIPTS}
-COPY ${ACTION}/steps.sh scripts/* ${SCRIPTS}/
-RUN chmod a+rx ${SCRIPTS}/*
-ENV  PATH "${SCRIPTS}:${PATH}"
-
-RUN mkdir /builds
-COPY ${ACTION}/builds.yml \
-     ${ACTION}/build.py \
-     seL4-platforms/platforms.yml \
+WORKDIR /builds
+COPY builds.yml \
+     build.py \
      seL4-platforms/platforms.py \
      seL4-platforms/builds.py \
-     /builds/
+     ./
 
-ARG WORKSPACE
-RUN mkdir -p ${WORKSPACE}
-WORKDIR ${WORKSPACE}
+WORKDIR /workspace
 
-ENTRYPOINT steps.sh
+ENTRYPOINT /ci-scripts/steps.sh
diff --git a/sel4test-sim/action.yml b/sel4test-sim/action.yml
index 0dd325b9..270aa844 100644
--- a/sel4test-sim/action.yml
+++ b/sel4test-sim/action.yml
@@ -36,4 +36,4 @@ inputs:
 
 runs:
   using: 'docker'
-  image: 'docker://sel4/sel4test-sim:latest'
+  image: 'Dockerfile'
diff --git a/sel4test-sim/seL4-platforms b/sel4test-sim/seL4-platforms
new file mode 120000
index 00000000..f24c9c72
--- /dev/null
+++ b/sel4test-sim/seL4-platforms
@@ -0,0 +1 @@
+../seL4-platforms
\ No newline at end of file