From 5953f4d5c76a387890b6c944823c25018b8dd257 Mon Sep 17 00:00:00 2001 From: Laura Couto Date: Tue, 15 Oct 2024 13:00:28 -0300 Subject: [PATCH] Add Github Actions workflow to trigger pipeline performance test Signed-off-by: Laura Couto --- .../workflows/pipeline-performance-test.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/pipeline-performance-test.yml diff --git a/.github/workflows/pipeline-performance-test.yml b/.github/workflows/pipeline-performance-test.yml new file mode 100644 index 0000000000..9d5156cd53 --- /dev/null +++ b/.github/workflows/pipeline-performance-test.yml @@ -0,0 +1,39 @@ +name: Trigger Pipeline Performance Test +on: + push: + branches: + - '**' + +jobs: + check-commit: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get the commit message (strip signature) + id: get_commit_message + run: | + commit_message=$(git log -1 --pretty=%B | sed -n '/^$/q;p') + echo "commit_message=$commit_message" >> $GITHUB_ENV + + - name: Get the branch name + id: get_branch_name + run: | + branch_name=${GITHUB_REF#refs/heads/} + echo "branch_name=$branch_name" >> $GITHUB_ENV + + - name: Check if commit contains 'PERFORMANCE TEST' + if: contains(env.commit_message, 'PERFORMANCE TEST') + run: | + echo "Commit message contains 'PERFORMANCE TEST'. Triggering performance test." + + - name: Trigger performance test workflow in test project + if: contains(env.commit_message, 'PERFORMANCE TEST') + run: | + curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GH_TAGGING_TOKEN }}" \ + https://api.github.com/repos/kedro-org/pipeline-performance-test/actions/workflows/performance-test.yml/dispatches \ + -d '{"ref":"main", "inputs": {"branch_name": "${{ env.branch_name }}"}}' \ No newline at end of file