From 47e8c92ef8a30efb49c0c61fced7abb1ec5cb41c Mon Sep 17 00:00:00 2001 From: Talysson Castro Date: Tue, 26 Dec 2023 12:55:11 -0400 Subject: [PATCH] chore: Add condition to run only unit test when branch is not master --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93cb2f0b..356ce899 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,11 +43,15 @@ jobs: - name: Print Version run: echo "Version ${{ steps.set-version.outputs.version }}" + - name: Set test suite + if: ${{ github.ref != 'refs/heads/master' }} + run: echo "GITHUB_TEST_SUITE=UnitTestSuite" >> $GITHUB_ENV + - name: Compile run: ./mvnw compile - name: Verify - run: ./mvnw --batch-mode verify -Danypoint.client.id=${{secrets.ANYPOINT_CLIENT_ID}} -Danypoint.client.secret=${{secrets.ANYPOINT_CLIENT_SECRET}} -Danypoint.connected-app.id=${{secrets.ANYPOINT_CONNECTED_APP_ID}} -Danypoint.connected-app.secret=${{secrets.ANYPOINT_CONNECTED_APP_SECRET}} -Danypoint.username=${{secrets.ANYPOINT_USERNAME}} -Danypoint.password=${{secrets.ANYPOINT_PASSWORD}} + run: ./mvnw --batch-mode verify -Dtest=$GITHUB_TEST_SUITE -Danypoint.client.id=${{secrets.ANYPOINT_CLIENT_ID}} -Danypoint.client.secret=${{secrets.ANYPOINT_CLIENT_SECRET}} -Danypoint.connected-app.id=${{secrets.ANYPOINT_CONNECTED_APP_ID}} -Danypoint.connected-app.secret=${{secrets.ANYPOINT_CONNECTED_APP_SECRET}} -Danypoint.username=${{secrets.ANYPOINT_USERNAME}} -Danypoint.password=${{secrets.ANYPOINT_PASSWORD}} - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2