CI: use openwrt official tools container by default
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 23 Jan 2023 18:47:41 +0000 (19:47 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 31 Jan 2023 15:36:57 +0000 (16:36 +0100)
Use openwrt official tools container by default.
Fork will use openwrt tools container by default.

This can be disabled by setting the option use_openwrt_container to
false for the build.yml and check-kernel-patches.yml.

The push-containers workflow is disabled on forks. The workflow can be
reenabled by commenting the condition in push-containers.yml.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
.github/workflows/build.yml
.github/workflows/check-kernel-patches.yml
.github/workflows/push-containers.yml

index 62a4441a3b7b6058989747ee22b38eb0d23f9716..19d3c23403e522bafb3d51fce9d37fec3457865c 100644 (file)
@@ -22,6 +22,9 @@ on:
         type: boolean
       build_all_boards:
         type: boolean
+      use_openwrt_container:
+        type: boolean
+        default: true
 
 permissions:
   contents: read
@@ -44,6 +47,11 @@ jobs:
         run: |
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
             | tr '[:upper:]' '[:lower:]')
+
+          if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
+            OWNER_LC=openwrt
+          fi
+
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
 
       - name: Generate ccache hash
index 7e0fe5071a5ace9d52c88db1fc247d90f36db03b..50a6d1495cf15f073a05103843161f9fd62a5f8b 100644 (file)
@@ -8,6 +8,9 @@ on:
         type: string
       testing:
         type: boolean
+      use_openwrt_container:
+        type: boolean
+        default: true
 
 permissions:
   contents: read
@@ -26,6 +29,11 @@ jobs:
         run: |
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
             | tr '[:upper:]' '[:lower:]')
+
+          if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
+            OWNER_LC=openwrt
+          fi
+
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
 
       # Per branch tools container tag
index cc13cda5725e9be7ed424580a33a005fb7513486..bad39c2fc2c9b35985ffccc98a75576dfc8571dd 100644 (file)
@@ -18,6 +18,7 @@ concurrency:
 jobs:
   build-linux-buildbot:
     name: Build tools with buildbot container
+    if: ${{ github.repository_owner  == 'openwrt' }}
     uses: ./.github/workflows/build-tools.yml
     with:
       generate_prebuilt_artifacts: true
@@ -25,6 +26,7 @@ jobs:
   push-tools-container:
     needs: build-linux-buildbot
     name: Push prebuilt tools container
+    if: ${{ github.repository_owner  == 'openwrt' }}
     runs-on: ubuntu-latest
 
     permissions: