diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index fffbf35684..c39b843c22 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 + name: utbot_intellij_tests_report + path: utbot-intellij/build/reports/tests/test/* diff --git a/.github/workflows/build-and-run-tests-utbot-java.yml b/.github/workflows/build-and-run-tests-utbot-java.yml deleted file mode 100644 index 08a0ceda10..0000000000 --- a/.github/workflows/build-and-run-tests-utbot-java.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: UTBot Java build and run tests - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - build-utbot-java: - if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} - 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: Build UTBot Java - run: | - export KOTLIN_HOME="/usr" - gradle clean build --no-daemon - - - name: Upload utbot-framework logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - 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 - 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: Upload IntelliJ IDEA plugin 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 diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml new file mode 100644 index 0000000000..7dc35d968c --- /dev/null +++ b/.github/workflows/build-and-run-tests.yml @@ -0,0 +1,47 @@ +name: UTBot Java build and run tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build_and_run_tests: + 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: Build and run tests in UTBot Java + run: | + export KOTLIN_HOME="/usr" + gradle clean build --no-daemon + + - name: Upload utbot-framework logs + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: utbot_framework_logs + path: utbot-framework/logs/* + + - name: Upload utbot-framework tests report artifacts if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: utbot_framework_tests_report + path: utbot-framework/build/reports/tests/test/* + + - name: Upload utbot-intellij tests report artifacts if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: utbot_intellij_tests_report + path: utbot-intellij/build/reports/tests/test/* 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 diff --git a/.github/workflows/publish-plugin-and-cli.yml b/.github/workflows/publish-plugin-and-cli.yml index ba182119fc..950265f252 100644 --- a/.github/workflows/publish-plugin-and-cli.yml +++ b/.github/workflows/publish-plugin-and-cli.yml @@ -1,35 +1,35 @@ -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 +40,9 @@ 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: