From 5911fed787d8a07c7d4a02f2f68b07bf95c2351a Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Thu, 7 Nov 2024 15:21:52 +0000 Subject: [PATCH 1/2] use matrix method and if cases to reduce workflow counts and complexity --- .github/workflows/bld_all.yml | 185 ----------- .github/workflows/bld_all_matrix.yml | 293 ------------------ .../workflows/{bld_maven.yml => bld_mvn.yml} | 68 ++-- .github/workflows/build_debug.yml | 101 ------ .github/workflows/build_test_release.yml | 119 ------- .github/workflows/build_test_release_tag.yml | 26 +- .../workflows/install_maven_dependencies.yml | 6 +- .github/workflows/lint.yml | 15 +- .github/workflows/maven_test_artifact.yml | 167 ---------- .github/workflows/maven_test_report.yml | 30 -- .../{maven_test_publish.yml => mvn_test.yml} | 66 ++-- .github/workflows/pr.yml | 7 +- .github/workflows/pr_completed.yml | 32 -- .github/workflows/rel_tag.yml | 2 +- .github/workflows/seed_maven_cache.yml | 6 +- .github/workflows/unit_tests_artifact.yml | 144 --------- .github/workflows/unit_tests_publish.yml | 180 ----------- .github/workflows/unit_tests_report.yml | 78 ----- 18 files changed, 111 insertions(+), 1414 deletions(-) delete mode 100644 .github/workflows/bld_all.yml delete mode 100644 .github/workflows/bld_all_matrix.yml rename .github/workflows/{bld_maven.yml => bld_mvn.yml} (85%) delete mode 100644 .github/workflows/build_debug.yml delete mode 100644 .github/workflows/build_test_release.yml delete mode 100644 .github/workflows/maven_test_artifact.yml delete mode 100644 .github/workflows/maven_test_report.yml rename .github/workflows/{maven_test_publish.yml => mvn_test.yml} (73%) delete mode 100644 .github/workflows/pr_completed.yml delete mode 100644 .github/workflows/unit_tests_artifact.yml delete mode 100644 .github/workflows/unit_tests_publish.yml delete mode 100644 .github/workflows/unit_tests_report.yml diff --git a/.github/workflows/bld_all.yml b/.github/workflows/bld_all.yml deleted file mode 100644 index ab01a41f63a..00000000000 --- a/.github/workflows/bld_all.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: bld_all - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - workflow_dispatch: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - -jobs: - - bld_ml: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-message-listener - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_amq: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-activemq - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_api: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-api-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_iapi: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-internal-api - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_pubweb: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-pub-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_sched: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-scheduler-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - bld_web: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - project: orcid-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - diff --git a/.github/workflows/bld_all_matrix.yml b/.github/workflows/bld_all_matrix.yml deleted file mode 100644 index f4f09df4882..00000000000 --- a/.github/workflows/bld_all_matrix.yml +++ /dev/null @@ -1,293 +0,0 @@ -name: bld_all_matrix - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - -jobs: - - bld: - strategy: - matrix: - # The include keyword that adds a new variable - include: - - artifact_name: orcid-message-listener - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-activemq - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-api-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-internal-api - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-pub-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-scheduler-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - artifact_name: orcid-web - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - - runs-on: ubuntu-latest - steps: - - - name: git-checkout-ref-action - id: ref - uses: ORCID/git-checkout-ref-action@main - with: - default_branch: ${{ github.event.repository.default_branch }} - ref: ${{ inputs.ref }} - - - uses: actions/checkout@v3 - with: - ref: ${{ steps.ref.outputs.ref }} - # checkout some history so we can scan commits for bump messages - # NOTE: history does not include tags! - fetch-depth: 100 - - - name: find next version - id: version - uses: ORCID/version-bump-action@main - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - - - name: Set up Open JDK 11 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - cache: 'maven' - - - name: show path - run: | - echo "$PATH" - which java - echo "$JAVA_HOME" - echo "$tag_numeric" - echo "$project" - shell: bash - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - project: "${{ matrix.artifact_name }}" - - - name: populate orcid-persistence/src/main/resources/release_name.txt with numeric tag - run: | - echo "$version_tag_numeric" > orcid-persistence/src/main/resources/release_name.txt - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: bump version of the parent pom and connected projects - run: | - mvn -T 1C --batch-mode versions:set \ - -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: bump the tagged version in the poms of projects not tied to the parent pom (orcid-test) - run: | - mvn -T 1C --batch-mode versions:set \ - -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-test - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: install orcid-parent into our local maven repo because the builds depend a version release - run: | - mvn -T 1C --batch-mode --non-recursive clean install -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: install orcid-test into our local maven repo because the builds depend a version release - run: | - mvn -T 1C --batch-mode clean install -DskipTests\ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-test - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: install orcid-utils into our local maven repo because the builds depend a version release - run: | - mvn -T 1C --batch-mode clean install -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-utils - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: install orcid-persistence into our local maven repo because orcid-core depends on it - run: | - mvn -T 1C --batch-mode clean install -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-persistence - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: install orcid-core into our local maven repo because the builds depend a version release - run: | - mvn -T 1C --batch-mode clean install -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-core - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - name: check some build related things - run: | - git --version - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git status - git diff - - - name: build our project - run: | - mvn -T 1C --batch-mode -am package -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects "$project" - echo "------------------------------------------------------" - - find . -name '*.war' - find . -name '*.jar' - env: - project: "${{ matrix.artifact_name }}" - -# -# orcid-web customization -# - - - name: setup node for angular static file - if: ${{ matrix.artifact_name == 'orcid-web' }} - uses: actions/setup-node@v3 - with: - node-version: 18.7.0 - - - name: build angular parts if we are building orcid-web - if: ${{ matrix.artifact_name == 'orcid-web' }} - run: | - echo "Build angular_orcid_generated.js" - cd orcid-nodejs - mvn -T 1C --batch-mode -P ci clean compile \ - -Dnodejs.workingDirectory="${{ github.workspace }}/orcid-web/src/main/webapp/static/javascript/ng1Orcid" \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - echo "Copying angular_orcid_generated to its final destination" - cp ${{ github.workspace }}/orcid-web/src/main/webapp/static/javascript/ng1Orcid/angular_orcid_generated.js ${{ github.workspace }}/orcid-web/target/orcid-web/static/javascript/ng1Orcid/ - - echo "Packaging orcid-web" - rm -f ${{ github.workspace }}/orcid-web/target/orcid-web.war - cd ${{ github.workspace }}/orcid-web/target/orcid-web - - # have a file on the webserver we can hit - echo "$version_tag_numeric" > ${{ github.workspace }}/orcid-web/target/orcid-web/static/version - - echo "Creating the war file" - jar -cf orcid-web.war . - - # check_error "Creating the orcid-web.war file" - echo "Moving war file to the target folder" - cp orcid-web.war ${{ github.workspace }}/orcid-web/target/ - echo "orcid-web.war is ready" - - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - project: "${{ matrix.artifact_name }}" - -################################################################################################################## - - - - name: install orcid-api-common into our local maven repo because the deploy depends on this orcid-web orcid-iapi orcid-api - if: ${{ matrix.artifact_name == 'orcid-web' }} || ${{ matrix.artifact_name == 'orcid-internal-api' }} || ${{ matrix.artifact_name == 'orcid-api-web' }} || ${{ matrix.artifact_name == 'orcid-pub-web' }} - run: | - mvn -T 1C --batch-mode clean install -DskipTests \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects orcid-api-common - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - - - - name: deploy war file - run: | - mvn --batch-mode \ - --settings settings-deploy.xml \ - --file "${project}/pom.xml" \ - -Dmaven.test.skip \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -DaltReleaseDeploymentRepository="github::${ARTIFACT_URL}${ARTIFACT_REPO_PATH}" \ - deploy -Dmaven.test.skip - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - ARTIFACT_URL: "${{ secrets.ARTIFACT_URL }}" - ARTIFACT_REPO_PATH: "${{ secrets.ARTIFACT_REPO_PATH }}" - ARTIFACT_USER: "${{ secrets.ARTIFACT_USER }}" - ARTIFACT_PASSWORD: "${{ secrets.ARTIFACT_PASSWORD }}" - project: "${{ matrix.artifact_name }}" - - - - - - diff --git a/.github/workflows/bld_maven.yml b/.github/workflows/bld_mvn.yml similarity index 85% rename from .github/workflows/bld_maven.yml rename to .github/workflows/bld_mvn.yml index 4683cb8898b..5638a7b0dc8 100644 --- a/.github/workflows/bld_maven.yml +++ b/.github/workflows/bld_mvn.yml @@ -1,5 +1,4 @@ -name: bld_maven -run-name: bld-{{ inputs.project }} +name: bld_mvn permissions: checks: write @@ -10,18 +9,13 @@ permissions: on: workflow_call: inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string version_tag: - description: 'Name of the tag to build' + description: 'Version tag to use: (bump must also be set to none to keep a specific version' required: false default: 'latest' type: string bump: - description: 'whether to bump the version number by a major minor patch amount or none' + description: 'whether to bump the version number by a major minor patch' required: false default: 'patch' type: string @@ -40,15 +34,14 @@ on: type: boolean required: false default: true - + deploy: + description: Whether to deploy the build to artifact repo + type: boolean + required: false + default: true workflow_dispatch: inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string version_tag: description: 'Version tag to use: (bump must also be set to none to keep a specific version' required: false @@ -80,10 +73,29 @@ on: type: boolean required: false default: true - + deploy: + description: Whether to deploy the build to artifact repo + type: boolean + required: false + default: true jobs: - bld_maven: + bld_mvn: + strategy: + matrix: + include: + - project: orcid-message-listener + - project: orcid-activemq + - project: orcid-api-web + - project: orcid-internal-api + - project: orcid-pub-web + - project: orcid-scheduler-web + - project: orcid-web + - project: orcid-utils + - project: orcid-core + - project: orcid-persistence + - project: orcid-api-common + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action @@ -93,7 +105,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -108,7 +120,7 @@ jobs: bump: ${{ inputs.bump }} - name: Set up Open JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' @@ -117,7 +129,7 @@ jobs: - name: if not installing dependencies restore special previous git_sha cache if: ${{ ! inputs.install_maven_dependencies }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }} @@ -136,7 +148,7 @@ jobs: - name: if installing dependencies use a standard cache key name if: ${{ inputs.install_maven_dependencies }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache @@ -167,20 +179,20 @@ jobs: find . -name '*.war' find . -name '*.jar' env: - project: "${{ inputs.project }}" + project: "${{ matrix.project }}" # # orcid-web customization # - name: setup node for angular static file - if: ${{ inputs.project == 'orcid-web' }} - uses: actions/setup-node@v3 + if: ${{ matrix.project == 'orcid-web' }} + uses: actions/setup-node@v4 with: node-version: 18.7.0 - name: build angular parts if we are building orcid-web - if: ${{ inputs.project == 'orcid-web' }} + if: ${{ matrix.project == 'orcid-web' }} run: | echo "Build angular_orcid_generated.js" cd orcid-nodejs @@ -208,11 +220,12 @@ jobs: env: version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - project: "${{ inputs.project }}" + project: "${{ matrix.project }}" ################################################################################################################## - name: deploy war file + if: ${{ inputs.deploy }} run: | mvn --batch-mode \ --settings settings-deploy.xml \ @@ -227,5 +240,6 @@ jobs: ARTIFACT_REPO_PATH: "${{ secrets.ARTIFACT_REPO_PATH }}" ARTIFACT_USER: "${{ secrets.ARTIFACT_USER }}" ARTIFACT_PASSWORD: "${{ secrets.ARTIFACT_PASSWORD }}" - project: "${{ inputs.project }}" + project: "${{ matrix.project }}" + diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml deleted file mode 100644 index fd8f1815b51..00000000000 --- a/.github/workflows/build_debug.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: build_debug - -on: - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "latest" - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or try gitlog' - required: false - default: "patch" - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "latest" - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default_branch" - type: string - - -# cancel running job if another commit comes in -concurrency: - group: main-${{ github.ref }}-1 - cancel-in-progress: true - -jobs: - seed_maven_cache: - uses: ./.github/workflows/seed_maven_cache.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - install_maven_dependencies: - uses: ./.github/workflows/install_maven_dependencies.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - needs: - - seed_maven_cache - - -############################################################################## - - unit_tests_publish: - uses: ./.github/workflows/maven_test_publish.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - project: orcid-message-listener - seed_maven_cache: false - install_maven_dependencies: false - needs: - - install_maven_dependencies - - bld_ml: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets for uploading assets - needs: - - seed_maven_cache - - unit_tests_publish - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - project: orcid-message-listener - seed_maven_cache: false - install_maven_dependencies: false diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml deleted file mode 100644 index 8b7ef2b2e64..00000000000 --- a/.github/workflows/build_test_release.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: build_test_release - -on: - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "latest" - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or try gitlog' - required: false - default: "patch" - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "latest" - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default_branch" - type: string - - -# cancel running job if another commit comes in -concurrency: - group: main-${{ github.ref }}-1 - cancel-in-progress: true - -jobs: - - lint: - uses: ./.github/workflows/lint.yml - - seed_maven_cache: - uses: ./.github/workflows/seed_maven_cache.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - install_maven_dependencies: - uses: ./.github/workflows/install_maven_dependencies.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - needs: - - seed_maven_cache - - unit_tests_publish: - uses: ./.github/workflows/unit_tests_publish.yml - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: false - install_maven_dependencies: false - needs: - - lint - - seed_maven_cache - - install_maven_dependencies -############################################################################## - bld_all: - uses: ./.github/workflows/bld_all.yml - secrets: inherit # pass all secrets for uploading assets - needs: - - lint - - unit_tests_publish - - install_maven_dependencies - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - seed_maven_cache: false - install_maven_dependencies: false - -############################################################################## - -# rel_tag: -# uses: ./.github/workflows/rel_tag.yml -# needs: bld_all -# with: -# version_tag: ${{ inputs.version_tag }} -# bump: ${{ inputs.bump }} -# ref: ${{ inputs.ref }} -# secrets: inherit # pass all secrets -# permissions: -# checks: write -# contents: write -# issues: read -# pull-requests: write diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/build_test_release_tag.yml index 5a1665df619..209e0d99910 100644 --- a/.github/workflows/build_test_release_tag.yml +++ b/.github/workflows/build_test_release_tag.yml @@ -18,6 +18,12 @@ on: required: false default: "default" type: string + rel_tag: + description: Whether to tag the code + type: boolean + required: false + default: true + workflow_dispatch: inputs: @@ -42,7 +48,11 @@ on: required: false default: "default_branch" type: string - + rel_tag: + description: Whether to tag the code + type: boolean + required: false + default: true # cancel running job if another commit comes in concurrency: @@ -70,8 +80,8 @@ jobs: needs: - seed_maven_cache - unit_tests_publish: - uses: ./.github/workflows/unit_tests_publish.yml + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -83,12 +93,12 @@ jobs: - seed_maven_cache - install_maven_dependencies ############################################################################## - bld_all: - uses: ./.github/workflows/bld_all.yml + bld_mvn: + uses: ./.github/workflows/bld_mvn.yml secrets: inherit # pass all secrets for uploading assets needs: - lint - - unit_tests_publish + - mvn_test - install_maven_dependencies permissions: checks: write @@ -106,7 +116,8 @@ jobs: rel_tag: uses: ./.github/workflows/rel_tag.yml - needs: bld_all + needs: bld_mvn + if: ${{ inputs.rel_tag }} with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -117,3 +128,4 @@ jobs: contents: write issues: read pull-requests: write + diff --git a/.github/workflows/install_maven_dependencies.yml b/.github/workflows/install_maven_dependencies.yml index 265c72c3a20..7c3332bdbdb 100644 --- a/.github/workflows/install_maven_dependencies.yml +++ b/.github/workflows/install_maven_dependencies.yml @@ -73,7 +73,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -88,13 +88,13 @@ jobs: bump: ${{ inputs.bump }} - name: Set up Open JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' - name: Restore the seeded cache but save dependencies into a new unique git sha hash with the expected version of the build - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a75a9f27b19..f7e9c0d9a33 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,17 +16,8 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - - name: set PY - run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV" - - uses: actions/cache@v3 - with: - path: ~/.cache - key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - # lockdown all 3rd party repos to git shas - #- uses: cloudposse/github-action-pre-commit@32acf3179b9eda817c0f549e8057477d320827db - # migrate to standard pre-commit - - uses: pre-commit/action@5f528da5c95691c4cf42ff76a4d10854b62cbb82 + - uses: pre-commit/action@576ff52938d158a24ac7e009dfa94b1455e7df99 diff --git a/.github/workflows/maven_test_artifact.yml b/.github/workflows/maven_test_artifact.yml deleted file mode 100644 index c13b03e6538..00000000000 --- a/.github/workflows/maven_test_artifact.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: maven_test_artifact - -# run maven tests and upload results as an artifact -# can be run from a pr - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - workflow_dispatch: - inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - -jobs: - maven_test: - runs-on: ubuntu-latest - steps: - - name: git-checkout-ref-action - id: ref - uses: ORCID/git-checkout-ref-action@main - with: - default_branch: ${{ github.event.repository.default_branch }} - ref: ${{ inputs.ref }} - - - uses: actions/checkout@v3 - with: - ref: ${{ steps.ref.outputs.ref }} - # checkout some history so we can scan commits for bump messages - # NOTE: history does not include tags! - fetch-depth: 100 - - - name: find next version - id: version - uses: ORCID/version-bump-action@main - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - - - name: Set up Open JDK 11 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - -######################################################################################## -# handle restoring a custom gha cache - - - name: if not installing dependencies restore special previous git_sha cache - if: ${{ ! inputs.install_maven_dependencies }} - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }} - - - name: bump version of the parent pom and connected projects - if: ${{ ! inputs.install_maven_dependencies }} - run: | - mvn -T 1C --batch-mode versions:set -DskipTests \ - -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false - env: - version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}" - -######################################################################################## - - - name: if installing dependencies use a standard cache key name - if: ${{ inputs.install_maven_dependencies }} - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache - restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache - - - name: seed_maven_cache - if: ${{ inputs.seed_maven_cache }} - id: cache - uses: ORCID/ORCID-Source-cache-action@main - with: - version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }} - - - name: install_dependencies and bump version - if: ${{ inputs.install_maven_dependencies }} - id: install_dependencies - uses: ORCID/ORCID-Source-dependencies-action@main - with: - version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }} - -######################################################################################## - - name: "Test ${{ inputs.project }}" - run: | - mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects ${{ inputs.project }} - - - uses: actions/upload-artifact@v3 # upload test results - if: success() || failure() # run this step even if previous step failed - with: - name: ${{ inputs.project }} - path: ${{ inputs.project }}/target/surefire-reports/*.xml diff --git a/.github/workflows/maven_test_report.yml b/.github/workflows/maven_test_report.yml deleted file mode 100644 index e44b1f70c99..00000000000 --- a/.github/workflows/maven_test_report.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: unit_test_report - -on: - workflow_call: - inputs: - project: - description: 'Name of the project in the repo' - required: false - default: "." - type: string - - workflow_dispatch: - inputs: - project: - description: 'Name of the project in the repo' - required: false - default: "." - type: string - -jobs: - report: - runs-on: ubuntu-latest - steps: - - uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 - with: - artifact: ${{ inputs.project }} - name: "maven_test_report_${{ inputs.project }}" # Name of the check run which will be created - path: '*.xml' # Path to test results (inside artifact .zip) - reporter: java-junit # Format of test results - diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/mvn_test.yml similarity index 73% rename from .github/workflows/maven_test_publish.yml rename to .github/workflows/mvn_test.yml index 33a6c1132d6..edb2f8d37a3 100644 --- a/.github/workflows/maven_test_publish.yml +++ b/.github/workflows/mvn_test.yml @@ -1,22 +1,13 @@ -name: maven_test_publish - -# run maven tests and publish results in one step -# run from privileged branch +name: mvn_test permissions: checks: write contents: read - issues: read - pull-requests: write + actions: read on: workflow_call: inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string version_tag: description: 'Name of the tag to build' required: false @@ -45,11 +36,6 @@ on: workflow_dispatch: inputs: - project: - description: 'Name of the artifact env' - required: false - default: 'prod' - type: string version_tag: description: 'Name of the tag to build' required: false @@ -78,7 +64,22 @@ on: jobs: - maven_test: + mvn_test: + strategy: + matrix: + include: + - project: orcid-message-listener + - project: orcid-activemq + - project: orcid-api-web + - project: orcid-internal-api + - project: orcid-pub-web + - project: orcid-scheduler-web + - project: orcid-web + - project: orcid-utils + - project: orcid-core + - project: orcid-persistence + - project: orcid-api-common + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action @@ -88,7 +89,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -103,7 +104,7 @@ jobs: bump: ${{ inputs.bump }} - name: Set up Open JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' @@ -113,7 +114,7 @@ jobs: - name: if not installing dependencies restore special previous git_sha cache if: ${{ ! inputs.install_maven_dependencies }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }} @@ -132,7 +133,7 @@ jobs: - name: if installing dependencies use a standard cache key name if: ${{ inputs.install_maven_dependencies }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache @@ -154,19 +155,24 @@ jobs: version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }} ######################################################################################## - - name: "Test ${{ inputs.project }}" + - name: "Test ${{ matrix.project }}" run: | - mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \ + mvn -T 1C --batch-mode test \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --projects ${{ inputs.project }} + --projects ${{ matrix.project }} --fail-at-end - # NOTE: if the above test fail then this step will report that failure and stop the run - - name: Publish Unit Test Results - uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203 - if: always() + - name: Publish unit test report for non forked repo + if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo + uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1 with: - name: "maven_test_publish_${{ inputs.project }}" - path: ${{ inputs.project }}/target/surefire-reports/*.xml + name: "Unit test report for ${{ matrix.project }}" + path: ${{ matrix.project }}/target/surefire-reports/*.xml reporter: java-junit fail-on-error: true + - name: Annotate only test report for forked repo + uses: mikepenz/action-junit-report@ec3a351c13e080dc4fa94c49ab7ad5bf778a9668 # v5 + if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo + with: + report_paths: ${{ matrix.project }}/target/surefire-reports/*.xml + annotate_only: true # forked repo cannot write to checks so just do annotations diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c243064af80..f151c70e622 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,8 +17,11 @@ concurrency: cancel-in-progress: true jobs: - unit_tests_artifact: - uses: ./.github/workflows/unit_tests_artifact.yml + lint: + uses: ./.github/workflows/lint.yml + + mvn_test: + uses: ./.github/workflows/mvn_test.yml with: seed_maven_cache: true install_maven_dependencies: true diff --git a/.github/workflows/pr_completed.yml b/.github/workflows/pr_completed.yml deleted file mode 100644 index 3d007a37690..00000000000 --- a/.github/workflows/pr_completed.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: pr_completed - -# this is a privileged workflow that can run with secrets -# to perform actions on work carried out in the pull_request workflow - -on: - workflow_run: - workflows: - - pr - types: - - completed - - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "next_tag" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: "next_tag" - type: string - -jobs: - unit_tests_report: - uses: ./.github/workflows/unit_tests_report.yml - diff --git a/.github/workflows/rel_tag.yml b/.github/workflows/rel_tag.yml index e125ac11d9a..529dc0bafb2 100644 --- a/.github/workflows/rel_tag.yml +++ b/.github/workflows/rel_tag.yml @@ -64,7 +64,7 @@ jobs: ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # token with write permissions to protected branches # standard github token does not allow this diff --git a/.github/workflows/seed_maven_cache.yml b/.github/workflows/seed_maven_cache.yml index aaf8d64d3b1..55eae9d17e3 100644 --- a/.github/workflows/seed_maven_cache.yml +++ b/.github/workflows/seed_maven_cache.yml @@ -71,7 +71,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -86,13 +86,13 @@ jobs: bump: ${{ inputs.bump }} - name: Set up Open JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' - name: Cache local Maven repository keyed off the pom - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache diff --git a/.github/workflows/unit_tests_artifact.yml b/.github/workflows/unit_tests_artifact.yml deleted file mode 100644 index 2340da69799..00000000000 --- a/.github/workflows/unit_tests_artifact.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: unit_tests_artifact - -# Run tests and upload the results as an artifact -# Can be run from a unprivileged pull_request action -# Reporting is done in the pr_completed.yml workflow - -on: - workflow_call: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - - workflow_dispatch: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - -jobs: - tst_ml: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-message-listener - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_amq: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-activemq - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_api: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-api-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_iapi: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-internal-api - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_pubweb: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-pub-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_sched: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-scheduler-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_web: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} -########################################################## - - tst_utils: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-utils - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_core: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-core - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_persistence: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-persistence - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - tst_api_common: - uses: ./.github/workflows/maven_test_artifact.yml - with: - project: orcid-api-common - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - - diff --git a/.github/workflows/unit_tests_publish.yml b/.github/workflows/unit_tests_publish.yml deleted file mode 100644 index e8cdbcdf91d..00000000000 --- a/.github/workflows/unit_tests_publish.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: unit_tests_publish - -# full unit tests with report publishing - -on: - workflow_call: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - - - workflow_dispatch: - inputs: - version_tag: - description: 'Name of the tag to build' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or none' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - seed_maven_cache: - description: Whether to seed cache - type: boolean - required: false - default: true - install_maven_dependencies: - description: Whether to install dependencies or use a previous cache - type: boolean - required: false - default: true - -jobs: - - - tst_ml: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-message-listener - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_amq: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-activemq - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_api: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-api-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_iapi: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-internal-api - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_pubweb: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-pub-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_sched: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-scheduler-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_web: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-web - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - -#################################################################### - - tst_utils: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-utils - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_core: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-core - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_persistence: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-persistence - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - tst_api_common: - uses: ./.github/workflows/maven_test_publish.yml - with: - project: orcid-api-common - seed_maven_cache: ${{ inputs.seed_maven_cache }} - install_maven_dependencies: ${{ inputs.install_maven_dependencies }} - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - -# codeql: -# uses: ./.github/workflows/codeql.yml -# diff --git a/.github/workflows/unit_tests_report.yml b/.github/workflows/unit_tests_report.yml deleted file mode 100644 index f3c5149dd01..00000000000 --- a/.github/workflows/unit_tests_report.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: unit_tests_report - -on: - workflow_call: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: latest - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use(vx.x.x)' - required: false - default: latest - type: string - -jobs: - - tst_ml: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-message-listener - - tst_amq: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-activemq - - tst_api: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-api-web - - tst_iapi: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-internal-api - - tst_pubweb: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-pub-web - - tst_sched: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-scheduler-web - - tst_web: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-web - -######################################################################################### - - tst_utils: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-utils - - tst_core: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-core - - tst_persistence: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-persistence - - tst_api_common: - uses: ./.github/workflows/maven_test_report.yml - with: - project: orcid-api-common - From 7324940810fc282379b12e7bf0a499ffe694775e Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Thu, 7 Nov 2024 18:04:54 +0000 Subject: [PATCH 2/2] more concistent naming --- .github/workflows/build_test_release_tag.yml | 6 +++--- .github/workflows/pr.yml | 4 ++-- .github/workflows/{mvn_test.yml => test_mvn.yml} | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename .github/workflows/{mvn_test.yml => test_mvn.yml} (99%) diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/build_test_release_tag.yml index 209e0d99910..ce821970320 100644 --- a/.github/workflows/build_test_release_tag.yml +++ b/.github/workflows/build_test_release_tag.yml @@ -80,8 +80,8 @@ jobs: needs: - seed_maven_cache - mvn_test: - uses: ./.github/workflows/mvn_test.yml + test_mvn: + uses: ./.github/workflows/test_mvn.yml with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} @@ -98,7 +98,7 @@ jobs: secrets: inherit # pass all secrets for uploading assets needs: - lint - - mvn_test + - test_mvn - install_maven_dependencies permissions: checks: write diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f151c70e622..4b13881b9b4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,8 +20,8 @@ jobs: lint: uses: ./.github/workflows/lint.yml - mvn_test: - uses: ./.github/workflows/mvn_test.yml + test_mvn: + uses: ./.github/workflows/test_mvn.yml with: seed_maven_cache: true install_maven_dependencies: true diff --git a/.github/workflows/mvn_test.yml b/.github/workflows/test_mvn.yml similarity index 99% rename from .github/workflows/mvn_test.yml rename to .github/workflows/test_mvn.yml index edb2f8d37a3..65e1190174c 100644 --- a/.github/workflows/mvn_test.yml +++ b/.github/workflows/test_mvn.yml @@ -1,4 +1,4 @@ -name: mvn_test +name: test_mvn permissions: checks: write @@ -64,7 +64,7 @@ on: jobs: - mvn_test: + test_mvn: strategy: matrix: include: