aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2022-08-08 23:37:54 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2022-09-30 22:26:54 +0200
commit25b65f548dfd93cae87781276bfff9a27cd3ebd4 (patch)
tree1cbdff943b9f8f6a4d709e561da2e077fbcd0fc2
parentebabdff4017fe2ed14491908ebe00589de0da189 (diff)
downloadupstream-25b65f548dfd93cae87781276bfff9a27cd3ebd4.tar.gz
upstream-25b65f548dfd93cae87781276bfff9a27cd3ebd4.tar.bz2
upstream-25b65f548dfd93cae87781276bfff9a27cd3ebd4.zip
CI: create Docker container containing compiled tools
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> Co-Developed-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--.github/workflows/Dockerfile.tools3
-rw-r--r--.github/workflows/tools.yml64
2 files changed, 67 insertions, 0 deletions
diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools
new file mode 100644
index 0000000000..c2ae7dc896
--- /dev/null
+++ b/.github/workflows/Dockerfile.tools
@@ -0,0 +1,3 @@
+FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
+
+COPY --chown=buildbot:buildbot tools.tar /tools.tar
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
index 52999758cf..54b7a01fe5 100644
--- a/.github/workflows/tools.yml
+++ b/.github/workflows/tools.yml
@@ -5,12 +5,17 @@ on:
paths:
- 'tools/**'
- '.github/workflows/tools.yml'
+ push:
+ paths:
+ - 'tools/**'
+ - '.github/workflows/tools.yml'
permissions:
contents: read
jobs:
build-macos-latest:
+ if: github.event_name != 'push'
runs-on: macos-latest
steps:
@@ -105,6 +110,15 @@ jobs:
run: |
chown -R buildbot:buildbot openwrt
+ - name: Set AUTOREMOVE config for tools container
+ if: github.event_name == 'push'
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: |
+ touch .config
+ echo CONFIG_DEVEL=y >> .config
+ echo CONFIG_AUTOREMOVE=y >> .config
+
- name: Make prereq
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
@@ -128,3 +142,53 @@ jobs:
with:
name: linux-buildbot-config
path: openwrt/.config
+
+ - name: Archive prebuilt tools
+ if: github.event_name == 'push'
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl
+
+ - name: Upload prebuilt tools
+ if: github.event_name == 'push'
+ uses: actions/upload-artifact@v2
+ with:
+ name: linux-buildbot-prebuilt-tools
+ path: openwrt/tools.tar
+ retention-days: 1
+
+ push-tools-container:
+ needs: build-linux-buildbot
+ runs-on: ubuntu-latest
+ if: github.event_name == 'push'
+
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ path: 'openwrt'
+
+ - name: Download prebuilt tools from build job
+ uses: actions/download-artifact@v2
+ with:
+ name: linux-buildbot-prebuilt-tools
+ path: openwrt
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v2
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and push
+ uses: docker/build-push-action@v3
+ with:
+ context: openwrt
+ push: true
+ tags: ghcr.io/${{ github.repository_owner }}/tools:latest
+ file: openwrt/.github/workflows/Dockerfile.tools