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: Extract prebuilt tools
88 shell: su buildbot -c "sh -e {0}"
89 working-directory: openwrt
90 run: ./scripts/ext-tools.sh --tools /tools.tar
92 - name: Configure testing kernel
93 if: inputs.testing == true
94 shell: su buildbot -c "sh -e {0}"
95 working-directory: openwrt
97 echo CONFIG_TESTING_KERNEL=y >> .config
99 - name: Configure system
100 shell: su buildbot -c "sh -e {0}"
101 working-directory: openwrt
103 echo CONFIG_ALL_KMODS=y >> .config
104 echo CONFIG_DEVEL=y >> .config
105 echo CONFIG_AUTOREMOVE=y >> .config
106 echo CONFIG_CCACHE=y >> .config
108 echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config
109 echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config
114 shell: su buildbot -c "sh -e {0}"
115 working-directory: openwrt
116 run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
118 - name: Refresh Kernel patches
119 shell: su buildbot -c "sh -e {0}"
120 working-directory: openwrt
122 make target/linux/refresh V=s
124 . .github/workflows/scripts/ci_helpers.sh
126 if git diff --name-only --exit-code; then
127 success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok"
129 err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)"