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: Fix permission
62 chown -R buildbot:buildbot openwrt
64 - name: Initialization environment
66 TARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 1)
67 SUBTARGET=$(echo ${{ matrix.target }} | cut -d "/" -f 2)
68 echo "TARGET=$TARGET" >> "$GITHUB_ENV"
69 echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
71 - name: Update & Install feeds
72 shell: su buildbot -c "sh -e {0}"
73 working-directory: openwrt
75 ./scripts/feeds update -a
76 ./scripts/feeds install -a
78 - name: Parse toolchain file
79 working-directory: openwrt
81 TOOLCHAIN_FILE=$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \
82 | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
84 echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
86 - name: Download external toolchain
87 shell: su buildbot -c "sh -e {0}"
88 working-directory: openwrt
90 wget -O - https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${TOOLCHAIN_FILE}.tar.xz \
93 - name: Configure external toolchain
94 shell: su buildbot -c "sh -e {0}"
95 working-directory: openwrt
97 ./scripts/ext-toolchain.sh \
98 --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \
99 --config ${{ env.TARGET }}/${{ env.SUBTARGET }}
103 - name: Show configuration
104 shell: su buildbot -c "sh -e {0}"
105 working-directory: openwrt
106 run: ./scripts/diffconfig.sh
109 shell: su buildbot -c "sh -e {0}"
110 working-directory: openwrt
111 run: make tools/install -j$(nproc) BUILD_LOG=1
113 - name: Build toolchain
114 shell: su buildbot -c "sh -e {0}"
115 working-directory: openwrt
116 run: make toolchain/install -j$(nproc) BUILD_LOG=1
119 shell: su buildbot -c "sh -e {0}"
120 working-directory: openwrt
121 run: make target/compile -j$(nproc) BUILD_LOG=1
125 uses: actions/upload-artifact@v2
127 name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs