Skip to content

Commit

Permalink
build-test-recipe.yml
Browse files Browse the repository at this point in the history
Changing to use LATEST_COMMIT_IN_PR, as this was wrong using the Workflow in a fork. Also setting to build for all RECIPES if there is no recipe changed, the flow here was wrong.
  • Loading branch information
thomas-roos authored Oct 23, 2024
1 parent 9b6792a commit 525d013
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build-test-recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
# See https://github.community/t/check-pushed-file-changes-with-git-diff-tree-in-github-actions/17220/10
if [ $GITHUB_BASE_REF ]; then
# Pull Request
git fetch origin ${{ github.base_ref }} ${{ github.event.pull_request.head.ref }}
LATEST_COMMIT_IN_PR=${{ github.event.pull_request.head.sha }}
git fetch origin $GITHUB_BASE_REF --depth=1
export DIFF=$( git diff --name-only origin/$GITHUB_BASE_REF $GITHUB_SHA )
echo "Diff between origin/$GITHUB_BASE_REF and $GITHUB_SHA"
export DIFF=$( git diff --name-only origin/$GITHUB_BASE_REF $LATEST_COMMIT_IN_PR )
echo "Diff between origin/$GITHUB_BASE_REF and $GITHUB_SHA"
else
# Push
git fetch origin ${{ github.event.before }} --depth=1
Expand Down Expand Up @@ -68,19 +70,17 @@ jobs:
run: |
echo diff:
echo ${{ needs.changed.outputs.diff }}
if [ " " == "${{ needs.changed.outputs.diff }}" ]; then
export RECIPES=$( echo "${{ needs.changed.outputs.diff }}" | tr ' ' '\n' | grep '\.bb.*$' | sed 's!.*/!!' | sed 's!.bb!!' | sed 's!_.*!!' | sort | uniq | sed -z $'s/\\\n/ /g')
if [ "" == "$RECIPES" ]; then
echo "No changed recipes, adding everything with a ptest to test, build"
THINGS_TO_EXCLUDE="! -name aws-lc* ! -name neo-ai-tv* ! -name corretto-17-bin* ! -name corretto-21-bin* ! -name corretto-8-bin* ! -name firecracker-bin* ! -name jailer-bin* ! -name amazon-kvs-producer-sdk-c* ! -name aws-cli-v2* "
if [ ${{ matrix.machine }} == "qemuarm" ]; then
THINGS_TO_EXCLUDE+="! -name amazon-kvs-webrtc-sdk*"
fi
export RECIPES=$(find meta-aws/ -name *.bb -type f \( ${THINGS_TO_EXCLUDE} \) -print | xargs grep -l 'inherit.*ptest.*'| sed 's!.*/!!' | sed 's!.bb!!' | sed 's!_.*!!' | sort | uniq | sed -z $'s/\\\n/ /g')
else
echo "Changed recipes"
export RECIPES=$( echo "${{ needs.changed.outputs.diff }}" | tr ' ' '\n' | grep '\.bb.*$' | sed 's!.*/!!' | sed 's!.bb!!' | sed 's!_.*!!' | sort | uniq | sed -z $'s/\\\n/ /g')
echo THINGS_TO_EXCLUDE: $THINGS_TO_EXCLUDE
fi
echo RECIPES to build, test: $RECIPES
echo THINGS_TO_EXCLUDE: $THINGS_TO_EXCLUDE
echo RECIPES to build, test: "$RECIPES"
echo "recipes=$RECIPES" >> $GITHUB_OUTPUT
- name: Run build
env:
Expand Down

0 comments on commit 525d013

Please sign in to comment.