diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be00db3a..d2ef8b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,22 +8,6 @@ env: BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }} jobs: - quality_checks: - uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v4.1.3 - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - install_java: true - - get_commit_id: - runs-on: ubuntu-22.04 - outputs: - commit_id: ${{ steps.commit_id.outputs.commit_id }} - steps: - - name: Get Commit ID - id: commit_id - run: | - echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT" get_asdf_version: runs-on: ubuntu-22.04 outputs: @@ -41,6 +25,24 @@ jobs: run: | TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT" + quality_checks: + uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v5.1.0 + needs: [get_asdf_version] + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }} + install_java: true + + get_commit_id: + runs-on: ubuntu-22.04 + outputs: + commit_id: ${{ steps.commit_id.outputs.commit_id }} + steps: + - name: Get Commit ID + id: commit_id + run: | + echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT" tag_release: needs: [quality_checks, get_commit_id, get_asdf_version] diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2216ddc6..a4bcc745 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,12 +8,31 @@ env: BRANCH_NAME: ${{ github.event.pull_request.head.ref }} jobs: + get_asdf_version: + runs-on: ubuntu-22.04 + outputs: + asdf_version: ${{ steps.asdf-version.outputs.version }} + tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }} + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Get asdf version + id: asdf-version + run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT" + - name: Load config value + id: load-config + run: | + TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) + echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT" quality_checks: - uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v4.1.3 - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v5.1.0 + needs: [get_asdf_version] with: + asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }} install_java: true + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} pr_title_format_check: uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/pr_title_check.yml@f80157cecce288dd175e61b477a1d2dbe9c88b99 @@ -44,23 +63,6 @@ jobs: ).data[0].number; } result-encoding: string - get_asdf_version: - runs-on: ubuntu-22.04 - outputs: - asdf_version: ${{ steps.asdf-version.outputs.version }} - tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }} - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Get asdf version - id: asdf-version - run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT" - - name: Load config value - id: load-config - run: | - TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) - echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT" tag_release: needs: [get_asdf_version] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1bc23af..a0c06190 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,23 +7,6 @@ env: BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }} jobs: - quality_checks: - uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v4.1.3 - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - install_java: true - - get_commit_id: - runs-on: ubuntu-22.04 - outputs: - commit_id: ${{ steps.commit_id.outputs.commit_id }} - steps: - - name: Get Commit ID - id: commit_id - run: | - echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT" - get_asdf_version: runs-on: ubuntu-22.04 outputs: @@ -41,6 +24,25 @@ jobs: run: | TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml) echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT" + quality_checks: + uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v5.1.0 + needs: [get_asdf_version] + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + install_java: true + asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }} + + get_commit_id: + runs-on: ubuntu-22.04 + outputs: + commit_id: ${{ steps.commit_id.outputs.commit_id }} + steps: + - name: Get Commit ID + id: commit_id + run: | + echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT" + tag_release: needs: [quality_checks, get_commit_id, get_asdf_version] uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@f80157cecce288dd175e61b477a1d2dbe9c88b99