6 - '.github/workflows/kernel.yml'
9 - 'target/linux/generic/**'
13 runs-on: ubuntu-latest
15 target: ${{ steps.find_targets.outputs.target }}
19 uses: actions/checkout@v2
24 export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
25 | sort -u -t '/' -k1,1 \
26 | awk '{ print $1 }')"
30 for TARGET in $TARGETS; do
31 [[ $FIRST -ne 1 ]] && JSON="$JSON"','
32 JSON="$JSON"'"'"${TARGET}"'"'
37 echo -e "\n---- targets ----\n"
39 echo -e "\n---- targets ----\n"
41 echo "::set-output name=target::$JSON"
44 name: Build Kernel with external toolchain
45 needs: determine_targets
46 runs-on: ubuntu-latest
50 target: ${{fromJson(needs.determine_targets.outputs.target)}}
52 container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
55 - name: Checkout master directory
56 uses: actions/checkout@v2
60 - name: Checkout packages feed
61 uses: actions/checkout@v2
63 repository: openwrt/packages
64 path: openwrt/feeds/packages
66 - name: Checkout luci feed
67 uses: actions/checkout@v2
69 repository: openwrt/luci
70 path: openwrt/feeds/luci
72 - name: Checkout routing feed
73 uses: actions/checkout@v2
75 repository: openwrt/routing
76 path: openwrt/feeds/routing
78 - name: Checkout telephony feed
79 uses: actions/checkout@v2
81 repository: openwrt/telephony
82 path: openwrt/feeds/telephony
84 - name: Fix permission
86 chown -R buildbot:buildbot openwrt
88 - name: Initialization environment
90 TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1)
91 SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2)
92 echo "TARGET=$TARGET" >> "$GITHUB_ENV"
93 echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
95 - name: Update & Install feeds
96 shell: su buildbot -c "sh -e {0}"
97 working-directory: openwrt
99 ./scripts/feeds update -a
100 ./scripts/feeds install -a
102 - name: Parse toolchain file
103 working-directory: openwrt
105 TOOLCHAIN_FILE=$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \
106 | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
108 echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
110 - name: Download external toolchain
111 shell: su buildbot -c "sh -e {0}"
112 working-directory: openwrt
114 wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \
117 - name: Configure external toolchain
118 shell: su buildbot -c "sh -e {0}"
119 working-directory: openwrt
121 echo CONFIG_ALL_KMODS=y >> .config
123 ./scripts/ext-toolchain.sh \
124 --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \
126 --config ${{ env.TARGET }}/${{ env.SUBTARGET }}
130 - name: Show configuration
131 shell: su buildbot -c "sh -e {0}"
132 working-directory: openwrt
133 run: ./scripts/diffconfig.sh
136 shell: su buildbot -c "sh -e {0}"
137 working-directory: openwrt
138 run: make tools/install -j$(nproc) BUILD_LOG=1
140 - name: Build toolchain
141 shell: su buildbot -c "sh -e {0}"
142 working-directory: openwrt
143 run: make toolchain/install -j$(nproc) BUILD_LOG=1
146 shell: su buildbot -c "sh -e {0}"
147 working-directory: openwrt
148 run: make target/compile -j$(nproc) BUILD_LOG=1
152 uses: actions/upload-artifact@v2
154 name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs