CI: create Docker container containing compiled tools docker-tools-github
authorPaul Spooren <mail@aparcar.org>
Mon, 8 Aug 2022 21:37:54 +0000 (23:37 +0200)
committerPaul Spooren <mail@aparcar.org>
Thu, 11 Aug 2022 15:17:09 +0000 (17:17 +0200)
Currently each Kernel compilation takes about 30 minutes of which 20
minutes are used to compile our tools. While the toolchain is downloaded
and instantly ready the tools are missing.

This commit starts uploading a Docker container including compiled tools
which are ready to use. It is automatically updated whenever any tools
are changed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
.github/workflows/Dockerfile.tools [new file with mode: 0644]
.github/workflows/kernel.yml
.github/workflows/tools.yml

diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools
new file mode 100644 (file)
index 0000000..a31820f
--- /dev/null
@@ -0,0 +1,5 @@
+FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
+
+COPY --chown=buildbot:buildbot ./openwrt/ /openwrt/
+
+WORKDIR /openwrt
index 05bc6ed8eeccf8ba1bd43528f77da4aa7f24ab74..952fabcecee5d71abc6e2d4f5f4a0e917ba60498 100644 (file)
@@ -49,8 +49,7 @@ jobs:
        matrix:
          target: ${{fromJson(needs.determine_targets.outputs.target)}}
 
-    container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
-
+    container: ghcr.io/openwrt/tools:latest
     steps:
       - name: Checkout master directory
         uses: actions/checkout@v2
index be967833cb4a92aca1896990eb78480ff4e5ded9..d75c4d320f578fc1097266973c78c6f16620d817 100644 (file)
@@ -5,6 +5,10 @@ on:
     paths:
       - 'tools/**'
       - '.github/workflows/tools.yml'
+  push:
+    paths:
+      - 'tools/**'
+      - '.github/workflows/tools.yml'
 
 jobs:
   build:
@@ -128,7 +132,6 @@ jobs:
           cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE"
           cp -r "$WORKPATH/.config" "$GITHUB_WORKSPACE/config"
 
-
       - name: Upload logs
         if: always()
         uses: actions/upload-artifact@v2
@@ -142,3 +145,12 @@ jobs:
         with:
           name: ${{ matrix.os }}-config
           path: "config"
+
+      - name: Build and push
+        if: matrix.os == 'ubuntu-latest'
+        #if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest'
+        uses: docker/build-push-action@v3
+        with:
+          push: true
+          tags: openwrt/tools:latest
+          file: .github/workflows/Dockerfile.tools