From ec521405f55e9b41d6d37f7741b959fc43ebbeff Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Tue, 2 Jul 2024 13:37:43 -0700 Subject: [PATCH] fix: fixing tests on main --- .github/workflows/pr-close.yml | 41 +++++++++++++++-------- .github/workflows/reusable-tests-repo.yml | 11 ++++-- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml index 4e250ed..bf31d9c 100644 --- a/.github/workflows/pr-close.yml +++ b/.github/workflows/pr-close.yml @@ -10,9 +10,34 @@ concurrency: cancel-in-progress: true jobs: + vars: + name: Variables + runs-on: ubuntu-latest + outputs: + semver: ${{ steps.semver.outputs.version }} + tag: ${{ steps.semver.outputs.tag }} + steps: + # steps.semver.outputs.tag => needs.vars.outputs.semver + - uses: actions/checkout@v4 + with: + ref: refs/heads/${{ github.event.repository.default_branch }} + - name: Conventional Changelog Update + uses: TriPSs/conventional-changelog-action@v5.3.0 + id: semver + with: + git-branch: refs/heads/${{ github.head_ref }} + git-push: 'false' + skip-commit: 'true' + skip-on-empty: 'false' + skip-version-file: 'true' + + - run: | + echo "semver=${{ steps.semver.outputs.version }}" + echo "tag=${{ steps.semver.outputs.tag }}" cleanup-jars: name: Cleanup Dev Images runs-on: ubuntu-22.04 + needs: [vars] env: NAME: ${{ github.event.repository.name }} steps: @@ -38,7 +63,7 @@ jobs: token: ${{ secrets.PAT }} type: maven name: ca.bc.gov.nrs-commons.forest-client-core - version: ${{ steps.changelog.outputs.version }}.PR${{ github.event.number }} + version: ${{ needs.vars.outputs.semver }}.PR${{ github.event.number }} user: ${{ github.repository_owner }} - name: Removing dev spring @@ -48,17 +73,5 @@ jobs: token: ${{ secrets.PAT }} type: maven name: ca.bc.gov.nrs-commons.forest-client-spring - version: ${{ steps.changelog.outputs.version }}.PR${{ github.event.number }} + version: ${{ needs.vars.outputs.semver }}.PR${{ github.event.number }} user: ${{ github.repository_owner }} - - image-promotions: - name: Image Promotions - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' - runs-on: ubuntu-22.04 - steps: - - uses: shrink/actions-docker-registry-tag@v4 - with: - registry: ghcr.io - repository: ${{ github.repository }}/certextractor - target: ${{ github.event.number }} - tags: prod diff --git a/.github/workflows/reusable-tests-repo.yml b/.github/workflows/reusable-tests-repo.yml index f21a380..8cc0f64 100644 --- a/.github/workflows/reusable-tests-repo.yml +++ b/.github/workflows/reusable-tests-repo.yml @@ -80,8 +80,15 @@ jobs: - name: Build Spring if: github.event_name != 'pull_request' - working-directory: spring - run: mvn clean package -Dcore.version=${{ needs.vars.outputs.semver }} + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 10 + retry_wait_seconds: 90 + command: | + cd spring + mvn clean package -Dcore.version=${{ needs.vars.outputs.semver }} - name: Build Spring if: github.event_name == 'pull_request'