aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-tools.yml
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-12-09 18:09:32 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-24 12:09:23 +0100
commitaf4417418749b9233c5a205affbcdea659cc685b (patch)
tree971f3a8e19731f34240d8b7a03fa20877ba21766 /.github/workflows/build-tools.yml
parentf649a7b5f337f1b2a69879b45ebafffec1380011 (diff)
downloadupstream-af4417418749b9233c5a205affbcdea659cc685b.tar.gz
upstream-af4417418749b9233c5a205affbcdea659cc685b.tar.bz2
upstream-af4417418749b9233c5a205affbcdea659cc685b.zip
CI: tools: reogranize and split workflow
Generilize tools workflow for future usage in shared workflow for tools build. Split tools workflow to tools and push-containers: - tools just execute build test - push-containers build and push prebuilt containers Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to '.github/workflows/build-tools.yml')
-rw-r--r--.github/workflows/build-tools.yml72
1 files changed, 72 insertions, 0 deletions
diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml
new file mode 100644
index 0000000000..ca415489c5
--- /dev/null
+++ b/.github/workflows/build-tools.yml
@@ -0,0 +1,72 @@
+name: Build host tools
+
+on:
+ workflow_call:
+ inputs:
+ generate_prebuilt_artifacts:
+ type: boolean
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ name: Build tools
+ runs-on: ubuntu-latest
+ container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ path: openwrt
+
+ - name: Fix permission
+ run: chown -R buildbot:buildbot openwrt
+
+ - name: Set configs for tools container
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: |
+ touch .config
+ echo CONFIG_DEVEL=y >> .config
+ echo CONFIG_AUTOREMOVE=y >> .config
+ echo CONFIG_CCACHE=y >> .config
+
+ - name: Make prereq
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: make defconfig
+
+ - name: Build tools
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
+
+ - name: Upload logs
+ if: always()
+ uses: actions/upload-artifact@v3
+ with:
+ name: linux-buildbot-logs
+ path: openwrt/logs
+
+ - name: Upload config
+ if: always()
+ uses: actions/upload-artifact@v3
+ with:
+ name: linux-buildbot-config
+ path: openwrt/.config
+
+ - name: Archive prebuilt tools
+ if: inputs.generate_prebuilt_artifacts == true
+ 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: inputs.generate_prebuilt_artifacts == true
+ uses: actions/upload-artifact@v3
+ with:
+ name: linux-buildbot-prebuilt-tools
+ path: openwrt/tools.tar
+ retention-days: 1