From e4363af9b8b84df855ebc1d19313b45c02ad011e Mon Sep 17 00:00:00 2001 From: Vyacheslav Tamarin Date: 2023年5月25日 13:48:34 +0300 Subject: [PATCH 1/5] Update publish-plugin-and-cli-from-branch.yml --- .../publish-plugin-and-cli-from-branch.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/publish-plugin-and-cli-from-branch.yml b/.github/workflows/publish-plugin-and-cli-from-branch.yml index 3c76174e43..69db769a0a 100644 --- a/.github/workflows/publish-plugin-and-cli-from-branch.yml +++ b/.github/workflows/publish-plugin-and-cli-from-branch.yml @@ -99,3 +99,41 @@ jobs: with: name: utbot-cli-${{ env.VERSION }} path: utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar + + - name: Build UTBot CLI Python + run: | + cd utbot-cli-python + gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} + + - name: Archive UTBot CLI Python + if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }} + uses: actions/upload-artifact@v3 + with: + name: utbot-cli-python-${{ env.VERSION }} + path: utbot-cli-python/build/libs/utbot-cli-python-${{ env.VERSION }}.jar + + - name: Build UTBot CLI Javascript + if: ${{ matrix.configuration.plugin_type == 'IU' }} + run: | + cd utbot-cli-js + gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} + + - name: Archive UTBot CLI Javascript + if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IU' }} + uses: actions/upload-artifact@v3 + with: + name: utbot-cli-js-${{ env.VERSION }} + path: utbot-cli-js/build/libs/utbot-cli-js-${{ env.VERSION }}.jar + + - name: Build UTBot CLI Go + if: ${{ matrix.configuration.plugin_type == 'IU' }} + run: | + cd utbot-cli-go + gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} + + - name: Archive UTBot CLI Go + if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IU' }} + uses: actions/upload-artifact@v3 + with: + name: utbot-cli-go-${{ env.VERSION }} + path: utbot-cli-go/build/libs/utbot-cli-go-${{ env.VERSION }}.jar From 0735f88e13ed72ff62752227af353878a3d31b6e Mon Sep 17 00:00:00 2001 From: Egor Vasilyev Date: 2023年5月31日 17:05:50 +0300 Subject: [PATCH 2/5] workflows rewrited to split plugin and cli building --- .github/workflows/build-and-run-tests.yml | 12 +- .github/workflows/publish-cli-from-branch.yml | 99 +++++++++++++ .../publish-plugin-and-cli-from-branch.yml | 139 ------------------ .../workflows/publish-plugin-from-branch.yml | 89 +++++++++++ 4 files changed, 198 insertions(+), 141 deletions(-) create mode 100644 .github/workflows/publish-cli-from-branch.yml delete mode 100644 .github/workflows/publish-plugin-and-cli-from-branch.yml create mode 100644 .github/workflows/publish-plugin-from-branch.yml diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index d3e8e68ba4..28636e1600 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -18,9 +18,17 @@ jobs: uses: ./.github/workflows/build-and-run-tests-from-branch.yml secrets: inherit - publish_plugin_and_cli: + publish_plugin: needs: build-and-run-tests - uses: ./.github/workflows/publish-plugin-and-cli-from-branch.yml + uses: ./.github/workflows/publish-plugin-from-branch.yml + with: + # upload artifacts on push action to main only + upload-artifact: ${{ github.event_name == 'push' }} + secrets: inherit + + publish_cli: + needs: build-and-run-tests + uses: ./.github/workflows/publish-cli-from-branch.yml with: # upload artifacts on push action to main only upload-artifact: ${{ github.event_name == 'push' }} diff --git a/.github/workflows/publish-cli-from-branch.yml b/.github/workflows/publish-cli-from-branch.yml new file mode 100644 index 0000000000..d5c8b12ce5 --- /dev/null +++ b/.github/workflows/publish-cli-from-branch.yml @@ -0,0 +1,99 @@ +name: "[M] CLI: publish as archive" + +on: + workflow_call: + inputs: + upload-artifact: + type: string + description: "Upload artifacts or not" + required: false + default: false + commit_sha: + required: false + type: string + description: "(optional) Commit SHA" + custom_version: + type: string + description: "Custom version" + required: false + default: "" + + workflow_dispatch: + inputs: + upload-artifact: + type: choice + description: "Upload artifacts or not" + required: false + default: true + options: + - true + - false + commit_sha: + required: false + type: string + description: "(optional) Commit SHA" + custom_version: + type: string + description: "Custom version" + required: false + default: "" + +jobs: + publish_cli: + strategy: + fail-fast: false # force to execute all jobs even though some of them have failed + matrix: + configuration: + - plugin_type: IC + extra_options: "-PideType=IC" + lang: java + dir: utbot-cli + - plugin_type: IC + extra_options: "-PideType=IC" + lang: python + dir: utbot-cli-python + - plugin_type: IU + extra_options: "-PideType=IU" + lang: go + dir: utbot-cli-go + - plugin_type: IU + extra_options: "-PideType=IU" + lang: js + dir: utbot-cli-js + runs-on: ubuntu-20.04 + container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 + steps: + - uses: actions/checkout@v3 + - name: Check out ${{ github.event.inputs.commit_sha }} commit + if: github.event.inputs.commit_sha != '' + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + git fetch + git checkout ${{ github.event.inputs.commit_sha }} + + # "You can make an environment variable available to any subsequent steps in a workflow job by + # defining or updating the environment variable and writing this to the GITHUB_ENV environment file." + - name: Setup custom version + if: ${{ github.event.inputs.custom_version != '' }} + run: | + echo "VERSION=${{ github.event.inputs.custom_version }}">> $GITHUB_ENV + - name: Setup version + if: ${{ github.event.inputs.custom_version == '' }} + shell: bash + run: | + echo "VERSION=${GITHUB_REF_NAME:0:4}-$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}">> $GITHUB_ENV + + - name: Print environment variables + run: printenv + + - name: Build UTBot CLI + run: | + cd "${{ matrix.configuration.dir }}" + gradle clean build --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} + + - name: Archive UTBot CLI + if: ${{ inputs.upload-artifact == 'true' }} + uses: actions/upload-artifact@v3 + with: + name: utbot-cli-${{ matrix.configuration.lang }}-${{ env.VERSION }} + path: ${{ matrix.configuration.dir }}/build/libs/utbot-cli-${{ env.VERSION }}.jar diff --git a/.github/workflows/publish-plugin-and-cli-from-branch.yml b/.github/workflows/publish-plugin-and-cli-from-branch.yml deleted file mode 100644 index 69db769a0a..0000000000 --- a/.github/workflows/publish-plugin-and-cli-from-branch.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: "[M] Plugin and CLI: publish as archives" - -on: - workflow_call: - inputs: - upload-artifact: - type: string - description: "Upload artifacts or not" - required: false - default: false - commit_sha: - required: false - type: string - description: "(optional) Commit SHA" - custom_version: - type: string - description: "Custom version" - required: false - default: "" - - workflow_dispatch: - inputs: - upload-artifact: - type: choice - description: "Upload artifacts or not" - required: false - default: true - options: - - true - - false - commit_sha: - required: false - type: string - description: "(optional) Commit SHA" - custom_version: - type: string - description: "Custom version" - required: false - default: "" - -jobs: - publish_plugin_and_cli: - strategy: - fail-fast: false # force to execute all jobs even though some of them have failed - matrix: - configuration: - - plugin_type: IC - extra_options: "-PideType=IC" - - plugin_type: IU - extra_options: "-PideType=IU" - runs-on: ubuntu-20.04 - container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 - steps: - - uses: actions/checkout@v3 - - name: Check out ${{ github.event.inputs.commit_sha }} commit - if: github.event.inputs.commit_sha != '' - run: | - git config --global --add safe.directory ${GITHUB_WORKSPACE} - git fetch - git checkout ${{ github.event.inputs.commit_sha }} - - # "You can make an environment variable available to any subsequent steps in a workflow job by - # defining or updating the environment variable and writing this to the GITHUB_ENV environment file." - - name: Setup custom version - if: ${{ github.event.inputs.custom_version != '' }} - run: | - echo "VERSION=${{ github.event.inputs.custom_version }}">> $GITHUB_ENV - - name: Setup version - if: ${{ github.event.inputs.custom_version == '' }} - shell: bash - run: | - echo "VERSION=${GITHUB_REF_NAME:0:4}-$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}">> $GITHUB_ENV - - - name: Print environment variables - run: printenv - - - name: Build UTBot IntelliJ IDEA plugin - run: | - gradle clean buildPlugin --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} - cd utbot-intellij/build/distributions - unzip utbot-intellij-${{ env.VERSION }}.zip - rm utbot-intellij-${{ env.VERSION }}.zip - - - name: Archive UTBot IntelliJ IDEA plugin - if: ${{ inputs.upload-artifact == 'true' }} - uses: actions/upload-artifact@v3 - with: - name: utbot-intellij-${{ matrix.configuration.plugin_type }}-${{ env.VERSION }} - path: utbot-intellij/build/distributions/* - - - name: Build UTBot CLI - run: | - cd utbot-cli - gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} - - - name: Archive UTBot CLI - if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }} - uses: actions/upload-artifact@v3 - with: - name: utbot-cli-${{ env.VERSION }} - path: utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar - - - name: Build UTBot CLI Python - run: | - cd utbot-cli-python - gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} - - - name: Archive UTBot CLI Python - if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }} - uses: actions/upload-artifact@v3 - with: - name: utbot-cli-python-${{ env.VERSION }} - path: utbot-cli-python/build/libs/utbot-cli-python-${{ env.VERSION }}.jar - - - name: Build UTBot CLI Javascript - if: ${{ matrix.configuration.plugin_type == 'IU' }} - run: | - cd utbot-cli-js - gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} - - - name: Archive UTBot CLI Javascript - if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IU' }} - uses: actions/upload-artifact@v3 - with: - name: utbot-cli-js-${{ env.VERSION }} - path: utbot-cli-js/build/libs/utbot-cli-js-${{ env.VERSION }}.jar - - - name: Build UTBot CLI Go - if: ${{ matrix.configuration.plugin_type == 'IU' }} - run: | - cd utbot-cli-go - gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} - - - name: Archive UTBot CLI Go - if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IU' }} - uses: actions/upload-artifact@v3 - with: - name: utbot-cli-go-${{ env.VERSION }} - path: utbot-cli-go/build/libs/utbot-cli-go-${{ env.VERSION }}.jar diff --git a/.github/workflows/publish-plugin-from-branch.yml b/.github/workflows/publish-plugin-from-branch.yml new file mode 100644 index 0000000000..a6459307cf --- /dev/null +++ b/.github/workflows/publish-plugin-from-branch.yml @@ -0,0 +1,89 @@ +name: "[M] Plugin: publish as archive" + +on: + workflow_call: + inputs: + upload-artifact: + type: string + description: "Upload artifacts or not" + required: false + default: false + commit_sha: + required: false + type: string + description: "(optional) Commit SHA" + custom_version: + type: string + description: "Custom version" + required: false + default: "" + + workflow_dispatch: + inputs: + upload-artifact: + type: choice + description: "Upload artifacts or not" + required: false + default: true + options: + - true + - false + commit_sha: + required: false + type: string + description: "(optional) Commit SHA" + custom_version: + type: string + description: "Custom version" + required: false + default: "" + +jobs: + publish_plugin_and_cli: + strategy: + fail-fast: false # force to execute all jobs even though some of them have failed + matrix: + configuration: + - plugin_type: IC + extra_options: "-PideType=IC" + - plugin_type: IU + extra_options: "-PideType=IU" + runs-on: ubuntu-20.04 + container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 + steps: + - uses: actions/checkout@v3 + - name: Check out ${{ github.event.inputs.commit_sha }} commit + if: github.event.inputs.commit_sha != '' + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + git fetch + git checkout ${{ github.event.inputs.commit_sha }} + + # "You can make an environment variable available to any subsequent steps in a workflow job by + # defining or updating the environment variable and writing this to the GITHUB_ENV environment file." + - name: Setup custom version + if: ${{ github.event.inputs.custom_version != '' }} + run: | + echo "VERSION=${{ github.event.inputs.custom_version }}">> $GITHUB_ENV + - name: Setup version + if: ${{ github.event.inputs.custom_version == '' }} + shell: bash + run: | + echo "VERSION=${GITHUB_REF_NAME:0:4}-$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}">> $GITHUB_ENV + + - name: Print environment variables + run: printenv + + - name: Build UTBot IntelliJ IDEA plugin + run: | + gradle clean buildPlugin --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} + cd utbot-intellij/build/distributions + unzip utbot-intellij-${{ env.VERSION }}.zip + rm utbot-intellij-${{ env.VERSION }}.zip + + - name: Archive UTBot IntelliJ IDEA plugin + if: ${{ inputs.upload-artifact == 'true' }} + uses: actions/upload-artifact@v3 + with: + name: utbot-intellij-${{ matrix.configuration.plugin_type }}-${{ env.VERSION }} + path: utbot-intellij/build/distributions/* From 5146c16ad885abe0cd39cda8359113f8accac15b Mon Sep 17 00:00:00 2001 From: Egor Vasilyev Date: Thu, 1 Jun 2023 09:04:35 +0300 Subject: [PATCH 3/5] fix artifact path --- .github/workflows/publish-cli-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-cli-from-branch.yml b/.github/workflows/publish-cli-from-branch.yml index d5c8b12ce5..66190711a1 100644 --- a/.github/workflows/publish-cli-from-branch.yml +++ b/.github/workflows/publish-cli-from-branch.yml @@ -96,4 +96,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: utbot-cli-${{ matrix.configuration.lang }}-${{ env.VERSION }} - path: ${{ matrix.configuration.dir }}/build/libs/utbot-cli-${{ env.VERSION }}.jar + path: ${{ matrix.configuration.dir }}/build/libs/${{ matrix.configuration.dir }}-${{ env.VERSION }}.jar From 7e987bd15e9d3e57dec1f7327f1cf52486a22da6 Mon Sep 17 00:00:00 2001 From: Egor Vasilyev Date: Thu, 1 Jun 2023 09:05:41 +0300 Subject: [PATCH 4/5] temporary upload artifacts --- .github/workflows/build-and-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 28636e1600..a8ff2e5632 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -31,7 +31,7 @@ jobs: uses: ./.github/workflows/publish-cli-from-branch.yml with: # upload artifacts on push action to main only - upload-artifact: ${{ github.event_name == 'push' }} + upload-artifact: true # temporary commented: ${{ github.event_name == 'push' }} secrets: inherit publish-cli-image: From 144998641eed2dbd49cc6877e7ce894d9463cc03 Mon Sep 17 00:00:00 2001 From: Egor Vasilyev Date: Thu, 1 Jun 2023 10:11:57 +0300 Subject: [PATCH 5/5] reverted from test to prod behavior --- .github/workflows/build-and-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index a8ff2e5632..28636e1600 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -31,7 +31,7 @@ jobs: uses: ./.github/workflows/publish-cli-from-branch.yml with: # upload artifacts on push action to main only - upload-artifact: true # temporary commented: ${{ github.event_name == 'push' }} + upload-artifact: ${{ github.event_name == 'push' }} secrets: inherit publish-cli-image:

AltStyle によって変換されたページ (->オリジナル) /