Skip to content

Commit

Permalink
Reactivate mirror_and_check
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-mnemonic committed Feb 1, 2024
1 parent b8565a9 commit 374a11f
Showing 1 changed file with 54 additions and 4 deletions.
58 changes: 54 additions & 4 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,65 @@ on:
workflow_dispatch:

jobs:
mirror_and_check:
runs-on: ubuntu-latest
outputs:
branch_matrix: ${{ steps.check.outputs.branch_matrix }}
steps:
- name: mirror
id: mirror
uses: bridgelightcloud/github-mirror-action@v3
with:
origin: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git'
GITHUB_TOKEN: ${{ secrets.PAT }}

- name: check
id: check
run: |
REPO=$( basename $PWD )
cd ..
mv $REPO ${REPO}.git
git clone --shared ${REPO}.git $REPO
JSON_DATA_FILE="$PWD/workflows.json"
touch ${JSON_DATA_FILE}
cd $REPO
# insert dummy element ###############################################
echo -n "[\"NO_BUILD\"" >> ${JSON_DATA_FILE}
# go through all configured branches and check for RCs ###############
for branch in $( cat config/rc-branches ); do
git worktree add ../${branch} ${branch}
pushd ../${branch}
pwd
if git log --oneline | head -n1 | grep "Linux\ .*\-rc.*" &>/dev/null; then
KERNEL_VERSION=$( git log --oneline | head -n1 | grep -o "Linux\ .*\-rc.*" )
echo "DEBUG build ${KERNEL_VERSION}"
echo "DEBUG , \"${branch}\""
echo -n ", \"${branch}\"" >> ${JSON_DATA_FILE}
fi
popd
pwd
done
echo -n "]" >> ${JSON_DATA_FILE}
pwd
cat -v ${JSON_DATA_FILE} || echo "DEBUG #2"
echo "branch_matrix=$( jq -cn --argjson environments "$( cat ${JSON_DATA_FILE} )" '{branch: $environments}' )" >> $GITHUB_OUTPUT
matrix_build:
# needs: mirror_and_check
needs: mirror_and_check
runs-on: ubuntu-latest
strategy:
fail-fast: false
# matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
matrix:
branch: [linux-4.19.y, linux-5.4.y, linux-5.10.y, linux-5.15.y, linux-6.1.y, linux-6.6.y, linux-6.7.y]
matrix: ${{fromJson(needs.mirror_and_check.outputs.branch_matrix)}}
# matrix:
# branch: [linux-4.19.y, linux-5.4.y, linux-5.10.y, linux-5.15.y, linux-6.1.y, linux-6.6.y, linux-6.7.y]
steps:
- name: no_build_step
run: |
if [[ ${{ matrix.branch }} == "NO_BUILD" ]]; then
echo "INFO: No build needed."
exit 1
fi
- uses: actions/checkout@v4
with:
ref: __mirror
Expand Down

0 comments on commit 374a11f

Please sign in to comment.