From f5f03d343db416503e7471b77b29fd3549633de7 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 09:58:28 +0300 Subject: [PATCH 1/7] Update publish-plugin-and-cli.yml --- .github/workflows/publish-plugin-and-cli.yml | 22 +++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-plugin-and-cli.yml b/.github/workflows/publish-plugin-and-cli.yml index ba182119fc..8dfa042d65 100644 --- a/.github/workflows/publish-plugin-and-cli.yml +++ b/.github/workflows/publish-plugin-and-cli.yml @@ -1,35 +1,34 @@ -name: Publish utbot-intellij and utbot-cli as an archive +name: Publish plugin and CLI as archives on: push: branches: [main] jobs: - publish_utbot_java: - if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} + publish_plugin_and_cli: runs-on: ubuntu-20.04 - env: - VERSION: ${{ format('1.0.{0}', github.run_number) }} - + steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: java-version: '8' - distribution: 'liberica' + distribution: 'zulu' java-package: jdk+fx - uses: gradle/gradle-build-action@v2 with: gradle-version: 6.8 + - name: Set environment variables + run: + echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV + - name: Build UTBot IntelliJ IDEA plugin run: | export KOTLIN_HOME="/usr" - gradle buildPlugin + gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} cd utbot-intellij/build/distributions - mv $(find . -type f -iname "utbot-intellij*.zip") utbot-intellij-${{ env.VERSION }}.zip unzip utbot-intellij-${{ env.VERSION }}.zip - rm utbot-intellij-${{ env.VERSION }}.zip - name: Archive UTBot IntelliJ IDEA plugin uses: actions/upload-artifact@v2 with: @@ -40,9 +39,8 @@ jobs: run: | export KOTLIN_HOME="/usr" cd utbot-cli - gradle clean build --no-daemon + gradle clean build --no-daemon -PsemVer=${{ env.VERSION }} cd build/libs - mv $(find . -type f -iname "utbot-cli*.jar") utbot-cli-${{ env.VERSION }}.jar - name: Archive UTBot CLI uses: actions/upload-artifact@v2 with: From d3ed5031e5b81a1aeda87443b69e08c28d779fa0 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:00:48 +0300 Subject: [PATCH 2/7] Create publish-plugin-and-cli-from-branch.yml --- .../publish-plugin-and-cli-from-branch.yml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/publish-plugin-and-cli-from-branch.yml diff --git a/.github/workflows/publish-plugin-and-cli-from-branch.yml b/.github/workflows/publish-plugin-and-cli-from-branch.yml new file mode 100644 index 0000000000..ba30f944f4 --- /dev/null +++ b/.github/workflows/publish-plugin-and-cli-from-branch.yml @@ -0,0 +1,65 @@ +name: Publish plugin and CLI as archives + +on: + workflow_dispatch: + inputs: + version-postfix: + type: choice + description: "It adds alpha or beta postfix to version." + required: true + default: no-postfix + options: + - no-postfix + - alpha + - beta + +jobs: + publish_plugin_and_cli: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'zulu' + java-package: jdk+fx + - uses: gradle/gradle-build-action@v2 + with: + gradle-version: 6.8 + + - name: Set environment variables + run: | + echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV + echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV + + - name: Create version with postfix + if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }} + run: + echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV + + - name: Build UTBot IntelliJ IDEA plugin + run: | + export KOTLIN_HOME="/usr" + gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} + cd utbot-intellij/build/distributions + unzip utbot-intellij-${{ env.VERSION }}.zip + + - name: Archive UTBot IntelliJ IDEA plugin + uses: actions/upload-artifact@v2 + with: + name: utbot-intellij-${{ env.VERSION }} + path: utbot-intellij/build/distributions/* + + - name: Build UTBot CLI + run: | + export KOTLIN_HOME="/usr" + cd utbot-cli + gradle clean build --no-daemon -PsemVer=${{ env.VERSION }} + cd build/libs + + - name: Archive UTBot CLI + uses: actions/upload-artifact@v2 + with: + name: utbot-cli-${{ env.VERSION }} + path: utbot-cli/build/libs/utbot-cli-${{ env.VERSION }}.jar From 8df4663ea5c24109831c58e83d7dc3102f9d6dee Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:01:26 +0300 Subject: [PATCH 3/7] Update publish-plugin-and-cli.yml --- .github/workflows/publish-plugin-and-cli.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-plugin-and-cli.yml b/.github/workflows/publish-plugin-and-cli.yml index 8dfa042d65..950265f252 100644 --- a/.github/workflows/publish-plugin-and-cli.yml +++ b/.github/workflows/publish-plugin-and-cli.yml @@ -29,6 +29,7 @@ jobs: gradle buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} cd utbot-intellij/build/distributions unzip utbot-intellij-${{ env.VERSION }}.zip + - name: Archive UTBot IntelliJ IDEA plugin uses: actions/upload-artifact@v2 with: @@ -41,6 +42,7 @@ jobs: cd utbot-cli gradle clean build --no-daemon -PsemVer=${{ env.VERSION }} cd build/libs + - name: Archive UTBot CLI uses: actions/upload-artifact@v2 with: From e2be5f81df4425c8ca0092c56fd523a677618574 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:22:15 +0300 Subject: [PATCH 4/7] Update build-and-run-tests-from-branch.yml --- .../build-and-run-tests-from-branch.yml | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index fffbf35684..b45170d36a 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -4,8 +4,7 @@ on: workflow_dispatch jobs: - build-utbot-java: - if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} + build-and-run-tests: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -18,7 +17,7 @@ jobs: with: gradle-version: 6.8 - - name: Build UTBot Java + - name: Build and run tests in UTBot Java run: | export KOTLIN_HOME="/usr" gradle clean build --no-daemon @@ -29,29 +28,17 @@ jobs: with: name: utbot_framework_logs path: utbot-framework/logs/* - - - name: Create tests report archive if tests have failed - if: ${{ failure() }} - run: | - cd utbot-framework/build/reports/tests/test - tar -czpf tests_run_report.tar.gz * - - name: Upload tests report artifacts if tests have failed + - name: Upload utbot-framework tests report artifacts if tests have failed if: ${{ failure() }} uses: actions/upload-artifact@v2 with: - name: tests_run_report.tar.gz - path: utbot-framework/build/reports/tests/test/tests_run_report.tar.gz - - - name: Create IntelliJ IDEA plugin tests report archive if tests have failed - if: ${{ failure() }} - run: | - cd utbot-intellij/build/reports/tests/test - tar -czpf intellij_plugin_tests_run_report.tar.gz * + name: utbot_framework_tests_report + path: utbot-framework/build/reports/tests/test/* - - name: Upload IntelliJ IDEA plugin tests report artifacts if tests have failed + - name: Upload utbot-intellij tests report artifacts if tests have failed if: ${{ failure() }} uses: actions/upload-artifact@v2 with: name: intellij_plugin_tests_run_report.tar.gz - path: utbot-intellij/build/reports/tests/test/intellij_plugin_tests_run_report.tar.gz + path: utbot-intellij/build/reports/tests/test/* From 3a28ccd5310101e290c0df18d0381de4d87f3ce3 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:47:34 +0300 Subject: [PATCH 5/7] Update build-and-run-tests-utbot-java.yml --- .../build-and-run-tests-utbot-java.yml | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-and-run-tests-utbot-java.yml b/.github/workflows/build-and-run-tests-utbot-java.yml index 08a0ceda10..7dc35d968c 100644 --- a/.github/workflows/build-and-run-tests-utbot-java.yml +++ b/.github/workflows/build-and-run-tests-utbot-java.yml @@ -7,8 +7,7 @@ on: branches: [main] jobs: - build-utbot-java: - if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} + build_and_run_tests: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -21,7 +20,7 @@ jobs: with: gradle-version: 6.8 - - name: Build UTBot Java + - name: Build and run tests in UTBot Java run: | export KOTLIN_HOME="/usr" gradle clean build --no-daemon @@ -32,29 +31,17 @@ jobs: with: name: utbot_framework_logs path: utbot-framework/logs/* - - - name: Create tests report archive if tests have failed - if: ${{ failure() }} - run: | - cd utbot-framework/build/reports/tests/test - tar -czpf tests_run_report.tar.gz * - - name: Upload tests report artifacts if tests have failed + - name: Upload utbot-framework tests report artifacts if tests have failed if: ${{ failure() }} uses: actions/upload-artifact@v2 with: - name: tests_run_report.tar.gz - path: utbot-framework/build/reports/tests/test/tests_run_report.tar.gz - - - name: Create IntelliJ IDEA plugin tests report archive if tests have failed - if: ${{ failure() }} - run: | - cd utbot-intellij/build/reports/tests/test - tar -czpf intellij_plugin_tests_run_report.tar.gz * + name: utbot_framework_tests_report + path: utbot-framework/build/reports/tests/test/* - - name: Upload IntelliJ IDEA plugin tests report artifacts if tests have failed + - name: Upload utbot-intellij tests report artifacts if tests have failed if: ${{ failure() }} uses: actions/upload-artifact@v2 with: - name: intellij_plugin_tests_run_report.tar.gz - path: utbot-intellij/build/reports/tests/test/intellij_plugin_tests_run_report.tar.gz + name: utbot_intellij_tests_report + path: utbot-intellij/build/reports/tests/test/* From 666cf616ce90aeafbd56f6d59b16ef8c34e084d3 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:48:37 +0300 Subject: [PATCH 6/7] Rename build-and-run-tests-utbot-java.yml to build-and-run-tests.yml --- ...build-and-run-tests-utbot-java.yml => build-and-run-tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-and-run-tests-utbot-java.yml => build-and-run-tests.yml} (100%) diff --git a/.github/workflows/build-and-run-tests-utbot-java.yml b/.github/workflows/build-and-run-tests.yml similarity index 100% rename from .github/workflows/build-and-run-tests-utbot-java.yml rename to .github/workflows/build-and-run-tests.yml From feae8db404077e423867977721160e2161a8814d Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 27 May 2022 10:49:34 +0300 Subject: [PATCH 7/7] Update build-and-run-tests-from-branch.yml --- .github/workflows/build-and-run-tests-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index b45170d36a..c39b843c22 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -40,5 +40,5 @@ jobs: if: ${{ failure() }} uses: actions/upload-artifact@v2 with: - name: intellij_plugin_tests_run_report.tar.gz + name: utbot_intellij_tests_report path: utbot-intellij/build/reports/tests/test/*