From 22367838abca708cc5e57dcc61a0c3d00b2eac62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Mon, 24 Jan 2022 15:27:40 +0100 Subject: [PATCH] Run analysis workflow on push too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise baseline results aren't generated Signed-off-by: Álvaro Brey Vilas --- .github/workflows/analysis.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 1983596f67..50f581ac27 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -3,6 +3,8 @@ name: "Analysis" on: pull_request: branches: [ master, stable-* ] + push: + branches: [ master, stable-* ] jobs: analysis: @@ -14,8 +16,25 @@ jobs: with: distribution: "temurin" java-version: 11 + - name: Setup variables + id: get-vars + run: | + if [ -z "$GITHUB_HEAD_REF" ]; then + # push + echo "::set-output name=branch::$GITHUB_REF_NAME" + echo "::set-output name=pr::$GITHUB_RUN_ID" + else + # pull request + echo "::set-output name=branch::$GITHUB_HEAD_REF" + echo "::set-output name=pr::${{ github.event.pull_request.number }}" + fi + - name: Show variables + run: | + echo "BRANCH: ${{ steps.get-vars.outputs.branch }}" + echo "PR: ${{ steps.get-vars.outputs.pr }}" + echo "RUN NUMBER: $GITHUB_RUN_NUMBER" - name: Run analysis wrapper run: | mkdir -p $HOME/.gradle echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties - scripts/analysis/analysis-wrapper.sh ${{ secrets.GIT_USERNAME }} ${{ secrets.GIT_TOKEN }} ${{ github.head_ref }} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} $GITHUB_RUN_NUMBER ${{ github.event.pull_request.number }} + scripts/analysis/analysis-wrapper.sh ${{ secrets.GIT_USERNAME }} ${{ secrets.GIT_TOKEN }} ${{ steps.get-vars.outputs.branch }} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} $GITHUB_RUN_NUMBER ${{ steps.get-vars.outputs.pr }}