From a056e69ddbe40f860166f56cbbcf8cc52076af60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 20 Nov 2024 11:55:14 +0800 Subject: [PATCH] Refactor dynamic workflow (#33731) * Add commit id support for dynamic ci * Add commit id support for dynamic ci * Refactor : refactor the chckout action for dynamic ci * Refactor : update the inputs set order --- .github/workflows/nightly-ci-dynamic.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly-ci-dynamic.yml b/.github/workflows/nightly-ci-dynamic.yml index d8ef7974c71db..cc5212bbcf5d6 100644 --- a/.github/workflows/nightly-ci-dynamic.yml +++ b/.github/workflows/nightly-ci-dynamic.yml @@ -20,14 +20,18 @@ name: Nightly - CI Dynamic on: workflow_dispatch: inputs: + os: + description: 'System OS' + required: false + default: "[ 'ubuntu-latest' ]" java-version: description: 'JDK Version' required: false default: "[ '21' ]" - os: - description: 'System OS' + commit-id: + description: 'Commit ID' required: false - default: "[ 'ubuntu-latest' ]" + default: "[ '' ]" job: description: 'Job Name' required: true @@ -53,11 +57,14 @@ jobs: matrix: os: ${{ fromJson(github.event.inputs.os) }} java-version: ${{ fromJson(github.event.inputs.java-version) }} + commit-id: ${{ fromJson(github.event.inputs.commit-id) }} steps: - name: Support Long Paths in Windows if: matrix.os == 'windows-latest' run: git config --global core.longpaths true - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-java@v4 with: distribution: 'temurin' @@ -69,6 +76,9 @@ jobs: restore-keys: | ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache- ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- + - name: Checkout with Commit ID + if: matrix.commit-id != '' + run: git checkout ${{ matrix.commit-id }} - name: Build Project with Maven run: ./mvnw clean install -B -ntp -T1C - name: Build Examples with Maven