1 name: Refresh kernel for target
18 runs-on: ubuntu-latest
20 owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
21 container_tag: ${{ steps.determine_tools_container.outputs.container_tag }}
24 - name: Set lower case owner name
27 OWNER_LC=$(echo "${{ github.repository_owner }}" \
28 | tr '[:upper:]' '[:lower:]')
29 echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
31 # Per branch tools container tag
32 # By default stick to latest
33 # For official test targetting openwrt stable branch
34 # Get the branch or parse the tag and push dedicated tools containers
35 # For local test to use the correct container for stable release testing
36 # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]-
37 - name: Determine tools container tag
38 id: determine_tools_container
41 if [ -n "${{ github.base_ref }}" ]; then
42 if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
43 CONTAINER_TAG="${{ github.base_ref }}"
45 elif [ ${{ github.ref_type }} == "branch" ]; then
46 if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
47 CONTAINER_TAG=${{ github.ref_name }}
48 elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
49 CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')"
51 elif [ ${{ github.ref_type }} == "tag" ]; then
52 if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
53 CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
56 echo "Tools container to use tools:$CONTAINER_TAG"
57 echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
60 name: Check Kernel patches
62 runs-on: ubuntu-latest
64 container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }}
71 - name: Checkout master directory
72 uses: actions/checkout@v3
76 - name: Fix permission
78 chown -R buildbot:buildbot openwrt
80 - name: Initialization environment
82 TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1)
83 SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2)
84 echo "TARGET=$TARGET" >> "$GITHUB_ENV"
85 echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
87 - name: Prepare prebuilt tools
88 shell: su buildbot -c "sh -e {0}"
89 working-directory: openwrt
91 mkdir -p staging_dir build_dir
92 ln -sf /prebuilt_tools/staging_dir/host staging_dir/host
93 ln -sf /prebuilt_tools/build_dir/host build_dir/host
95 ./scripts/ext-tools.sh --refresh
97 - name: Configure testing kernel
98 if: inputs.testing == true
99 shell: su buildbot -c "sh -e {0}"
100 working-directory: openwrt
102 echo CONFIG_TESTING_KERNEL=y >> .config
104 - name: Configure system
105 shell: su buildbot -c "sh -e {0}"
106 working-directory: openwrt
108 echo CONFIG_ALL_KMODS=y >> .config
109 echo CONFIG_DEVEL=y >> .config
110 echo CONFIG_AUTOREMOVE=y >> .config
111 echo CONFIG_CCACHE=y >> .config
113 echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config
114 echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config
119 shell: su buildbot -c "sh -e {0}"
120 working-directory: openwrt
121 run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
123 - name: Refresh Kernel patches
124 shell: su buildbot -c "sh -e {0}"
125 working-directory: openwrt
127 make target/linux/refresh V=s
129 . .github/workflows/scripts/ci_helpers.sh
131 if git diff --name-only --exit-code; then
132 success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok"
134 err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)"