From edf473147ad22ff6467d9263e4a8668c1cf09732 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:14:38 +0300 Subject: [PATCH 01/19] Combine projects runs --- .../build-and-run-tests-from-branch.yml | 91 ++++++++++++++++--- 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index a6fb5a3bdc..527db5b0a2 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -22,7 +22,7 @@ env: GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -javaagent:/tmp/jmx-exporter.jar=12345:/tmp/jmx-exporter.yml -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false" jobs: - prepare-tests-matrix: + prepare-matrices: runs-on: ubuntu-latest # Outputs are used for passing data to dependent jobs. outputs: @@ -39,23 +39,24 @@ jobs: run: | git fetch git checkout ${{ github.event.inputs.commit_sha }} - - id: set-matrix - name: Read and print config from framework-tests-matrix.json + - id: set-matrices + name: Read and print config from framework-tests-matrix.json and combined-projects-matrix.json run: | - TASKS=$(echo $(cat .github/workflows/framework-tests-matrix.json)) - echo "::set-output name=matrix::$TASKS" - echo $TASKS + FRAMEWORK_TESTS=$(echo $(cat .github/workflows/framework-tests-matrix.json)) + COMBINED_PROJECTS=$(echo $(cat .github/workflows/combined-projects-matrix.json)) + echo "::set-output name=framework-tests-matrix::$FRAMEWORK_TESTS" + echo "::set-output name=combined-projects-matrix::$COMBINED_PROJECTS" + echo $FRAMEWORK_TESTS + echo $COMBINED_PROJECTS + framework: - # This job does not need to wait for 'prepare-tests-matrix' result. - # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them - # to start execution early. - needs: prepare-tests-matrix + needs: prepare-matrices # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: # The option forces to execute all jobs even though some of them have failed. fail-fast: false - matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.matrix) }} + matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.framework-tests-matrix) }} runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: @@ -100,16 +101,77 @@ jobs: name: test_report ${{ matrix.project.PART_NAME }} path: utbot-framework/build/reports/tests/test/* + combined-projects: + # This job does not need to wait for 'prepare-tests-matrix' result. + # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them + # to start execution early. + needs: prepare-matrices + # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. + # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs + strategy: + # The option forces to execute all jobs even though some of them have failed. + fail-fast: false + matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.combined-projects-matrix) }} + runs-on: ubuntu-20.04 + container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 + steps: + - name: Print environment variables + run: printenv - project: - needs: prepare-tests-matrix + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check out ${{ github.event.inputs.commit_sha }} commit + if: github.event.inputs.commit_sha != '' + run: | + git fetch + git checkout ${{ github.event.inputs.commit_sha }} + - uses: actions/checkout@v3 + with: + ref: ${{ env.COMMIT_SHA }} + + - name: Run monitoring + run: | + echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} + chmod +x ./scripts/monitoring.sh + ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + - name: Build project ${{ matrix.projects.first }} + id: first-project + run: | + cd ${{ matrix.projects.first }} + gradle build --no-daemon + - name: Build project ${{ matrix.projects.second }} + if: ${{ steps.first-project.outcome != 'cancelled' && steps.first-project.outcome != 'skipped' }} + run: | + cd ${{ matrix.projects.second }} + gradle build --no-daemon + - name: Upload test report if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test_report ${{ matrix.projects.first }} + path: ${{ matrix.projects.first }}/build/reports/tests/test/* + + - name: Upload test report if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test_report ${{ matrix.projects.second }} + path: ${{ matrix.projects.second }}/build/reports/tests/test/* + + + single-project: + # This job does not need to wait for 'prepare-tests-matrix' result. + # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them + # to start execution early. + needs: prepare-matrices # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: # The option forces to execute all jobs even though some of them have failed. fail-fast: false matrix: - project: [utbot-api, utbot-cli, utbot-core, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-instrumentation, utbot-instrumentation-tests, utbot-intellij, utbot-junit-contest, utbot-sample, utbot-summary, utbot-summary-tests] + project: [utbot-api, utbot-core, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample] runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: @@ -143,3 +205,4 @@ jobs: with: name: test_report ${{ matrix.project }} path: ${{ matrix.project }}/build/reports/tests/test/* + From 0a513a73cc63300c74ec89d3ea7d9215c64095a5 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:45:12 +0300 Subject: [PATCH 02/19] Update outputs --- .github/workflows/build-and-run-tests-from-branch.yml | 3 ++- 1 file changed, 2 insertions(+), 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 527db5b0a2..992ed3f8d8 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -26,7 +26,8 @@ jobs: runs-on: ubuntu-latest # Outputs are used for passing data to dependent jobs. outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + framework-tests-matrix: ${{ steps.set-matrix.outputs.framework-tests-matrix }} + combined-projects-matrix: ${{ steps.set-matrix.outputs.combined-projects-matrix }} steps: - name: Print environment variables run: printenv From 0c030921d412401d327e185100ad4cb4abf5b2ee Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:48:16 +0300 Subject: [PATCH 03/19] Update needed job --- .github/workflows/build-and-run-tests-from-branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 992ed3f8d8..aecc73a4fa 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -57,7 +57,7 @@ jobs: strategy: # The option forces to execute all jobs even though some of them have failed. fail-fast: false - matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.framework-tests-matrix) }} + matrix: ${{ fromJson(needs.prepare-matrices.outputs.framework-tests-matrix) }} runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: @@ -112,7 +112,7 @@ jobs: strategy: # The option forces to execute all jobs even though some of them have failed. fail-fast: false - matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.combined-projects-matrix) }} + matrix: ${{ fromJson(needs.prepare-matrices.outputs.combined-projects-matrix) }} runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: From 46d3d91d00af6943b7d5601b6eb14ac9063a315d Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:51:10 +0300 Subject: [PATCH 04/19] Rename job: framework -> framework-tests --- .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 aecc73a4fa..2626a8c09d 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -50,7 +50,7 @@ jobs: echo $FRAMEWORK_TESTS echo $COMBINED_PROJECTS - framework: + framework-tests: needs: prepare-matrices # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs From b8423d22135881c38bf04020b2a66fda57bb7f4c Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:00:40 +0300 Subject: [PATCH 05/19] Using right job id --- .github/workflows/build-and-run-tests-from-branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 2626a8c09d..79a9e3ff4a 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -26,8 +26,8 @@ jobs: runs-on: ubuntu-latest # Outputs are used for passing data to dependent jobs. outputs: - framework-tests-matrix: ${{ steps.set-matrix.outputs.framework-tests-matrix }} - combined-projects-matrix: ${{ steps.set-matrix.outputs.combined-projects-matrix }} + framework-tests-matrix: ${{ steps.set-matrices.outputs.framework-tests-matrix }} + combined-projects-matrix: ${{ steps.set-matrices.outputs.combined-projects-matrix }} steps: - name: Print environment variables run: printenv From a0cab8bbaf8b2536f94e835aefc66def857c7966 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:16:51 +0300 Subject: [PATCH 06/19] Create combined-projects-matrix.json --- .github/workflows/combined-projects-matrix.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/combined-projects-matrix.json diff --git a/.github/workflows/combined-projects-matrix.json b/.github/workflows/combined-projects-matrix.json new file mode 100644 index 0000000000..81af4c2172 --- /dev/null +++ b/.github/workflows/combined-projects-matrix.json @@ -0,0 +1,16 @@ +{ + "projects": [ + { + "FIRST": "utbot-intellij", + "SECOND": "utbot-cli", + }, + { + "FIRST": "utbot-instrumentation", + "SECOND": "utbot-instrumentation-tests", + }, + { + "FIRST": "utbot-summary", + "SECOND": "utbot-summary-tests", + } + ] +} From 303d14a9fde31661f0b40637c364d8ca23f5cddf Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:34:01 +0300 Subject: [PATCH 07/19] Combine utbot-api and utbot-framework-api --- .github/workflows/combined-projects-matrix.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/combined-projects-matrix.json b/.github/workflows/combined-projects-matrix.json index 81af4c2172..823e0a2624 100644 --- a/.github/workflows/combined-projects-matrix.json +++ b/.github/workflows/combined-projects-matrix.json @@ -11,6 +11,10 @@ { "FIRST": "utbot-summary", "SECOND": "utbot-summary-tests", + }, + { + "FIRST": "utbot-api", + "SECOND": "utbot-framework-api", } ] } From 4c019e4cd0b3321c76fc8ea59d908feff98f0a1f Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:36:03 +0300 Subject: [PATCH 08/19] Workflow: combine api and framework-api --- .github/workflows/build-and-run-tests-from-branch.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 79a9e3ff4a..22d31e1bb5 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -172,7 +172,7 @@ jobs: # The option forces to execute all jobs even though some of them have failed. fail-fast: false matrix: - project: [utbot-api, utbot-core, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample] + project: [utbot-core, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample] runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: @@ -206,4 +206,3 @@ jobs: with: name: test_report ${{ matrix.project }} path: ${{ matrix.project }}/build/reports/tests/test/* - From 5959e77dd0c2fca99d8ae71ea1cc38314a0e2d98 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 16:58:49 +0300 Subject: [PATCH 09/19] Updates from main --- .github/workflows/build-and-run-tests-from-branch.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 38123357ee..0b328e205b 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -19,7 +19,7 @@ env: IMAGE_NAME: utbot_java_cli DOCKERFILE_PATH: docker/Dockerfile_java_cli # Environment variable setting gradle options. - GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -javaagent:/tmp/jmx-exporter.jar=12345:/tmp/jmx-exporter.yml -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false" + GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false" jobs: prepare-matrices: @@ -38,6 +38,7 @@ jobs: - 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 }} - id: set-matrices @@ -69,6 +70,7 @@ jobs: - 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 }} - name: Run monitoring @@ -124,6 +126,7 @@ jobs: - 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 }} - uses: actions/checkout@v3 @@ -184,6 +187,7 @@ jobs: - 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 }} - uses: actions/checkout@v3 @@ -204,4 +208,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: test_report ${{ matrix.project }} - path: ${{ matrix.project }}/build/reports/tests/test/* \ No newline at end of file + path: ${{ matrix.project }}/build/reports/tests/test/* From f4dd95f8c04a067ca99cf897df0f6f7fd585c7b7 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 17:06:20 +0300 Subject: [PATCH 10/19] Return back changes from main --- .../build-and-run-tests-from-branch.yml | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 0b328e205b..0de368f778 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -61,47 +61,47 @@ jobs: runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: - - name: Print environment variables - run: printenv + - name: Print environment variables + run: printenv - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + 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 }} - - name: Run monitoring - run: | - echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} - chmod +x ./scripts/monitoring.sh - ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - - name: Run tests - run: | - gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }} - - name: Upload logs - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: logs ${{ matrix.project.PART_NAME }} - path: utbot-framework/logs/* + - 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 }} + - name: Run monitoring + run: | + echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} + chmod +x ./scripts/monitoring.sh + ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + - name: Run tests + run: | + gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }} + - name: Upload logs + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: logs ${{ matrix.project.PART_NAME }} + path: utbot-framework/logs/* - - name: Upload UTBot temp directory content - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: utbot_temp ${{ matrix.project.PART_NAME }} - path: | - /tmp/UTBot/generated*/* - /tmp/UTBot/utbot-childprocess-errors/* - - name: Upload test report if tests have failed - if: ${{ failure() }} - uses: actions/upload-artifact@v3 - with: - name: test_report ${{ matrix.project.PART_NAME }} - path: utbot-framework/build/reports/tests/test/* + - name: Upload UTBot temp directory content + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: utbot_temp ${{ matrix.project.PART_NAME }} + path: | + /tmp/UTBot/generated*/* + /tmp/UTBot/utbot-childprocess-errors/* + - name: Upload test report if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test_report ${{ matrix.project.PART_NAME }} + path: utbot-framework/build/reports/tests/test/* combined-projects: # This job does not need to wait for 'prepare-tests-matrix' result. @@ -197,8 +197,8 @@ jobs: - name: Run monitoring run: | echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} - chmod +x ./scripts/monitoring.sh - ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + chmod +x ./scripts/project/monitoring.sh + ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - name: Run tests run: | cd ${{ matrix.project }} From 0a092db417909b11c13e74785a65e29ce7464f9f Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 17:10:26 +0300 Subject: [PATCH 11/19] Return changes from main (2) --- .../build-and-run-tests-from-branch.yml | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 0de368f778..b7f4969f5a 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -178,34 +178,34 @@ jobs: runs-on: ubuntu-20.04 container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 steps: - - name: Print environment variables - run: printenv + - name: Print environment variables + run: printenv - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + 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 }} - - uses: actions/checkout@v3 - with: - ref: ${{ env.COMMIT_SHA }} + - 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 }} + - uses: actions/checkout@v3 + with: + ref: ${{ env.COMMIT_SHA }} - - name: Run monitoring - run: | - echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} - chmod +x ./scripts/project/monitoring.sh - ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - - name: Run tests - run: | - cd ${{ matrix.project }} - gradle build --no-daemon - - name: Upload test report if tests have failed - if: ${{ failure() }} - uses: actions/upload-artifact@v3 - with: - name: test_report ${{ matrix.project }} - path: ${{ matrix.project }}/build/reports/tests/test/* + - name: Run monitoring + run: | + echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} + chmod +x ./scripts/project/monitoring.sh + ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + - name: Run tests + run: | + cd ${{ matrix.project }} + gradle build --no-daemon + - name: Upload test report if tests have failed + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: test_report ${{ matrix.project }} + path: ${{ matrix.project }}/build/reports/tests/test/* From a38a47f8b61c62fe576c057ac88482f50488fb97 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Fri, 16 Sep 2022 18:46:03 +0300 Subject: [PATCH 12/19] Return back changes from main --- .github/workflows/build-and-run-tests-from-branch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index b7f4969f5a..87ee40ab17 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -76,8 +76,8 @@ jobs: - name: Run monitoring run: | echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} - chmod +x ./scripts/monitoring.sh - ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + chmod +x ./scripts/project/monitoring.sh + ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - name: Run tests run: | gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }} @@ -136,8 +136,8 @@ jobs: - name: Run monitoring run: | echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"} - chmod +x ./scripts/monitoring.sh - ./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} + chmod +x ./scripts/project/monitoring.sh + ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - name: Build project ${{ matrix.projects.first }} id: first-project run: | From 7d0469f0dde496f702786a57e7ee7b2ff29ca6ca Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 10:03:21 +0300 Subject: [PATCH 13/19] Remove useless tabs --- .../workflows/build-and-run-tests-from-branch.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 87ee40ab17..cab30e8fc2 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -31,10 +31,10 @@ jobs: steps: - name: Print environment variables run: printenv - + - name: Checkout repository uses: actions/checkout@v3 - + - name: Check out ${{ github.event.inputs.commit_sha }} commit if: github.event.inputs.commit_sha != '' run: | @@ -55,7 +55,7 @@ jobs: # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: - # The option forces to execute all jobs even though some of them have failed. + # The option forces to execute all jobs even though some of them have failed. fail-fast: false matrix: ${{ fromJson(needs.prepare-matrices.outputs.framework-tests-matrix) }} runs-on: ubuntu-20.04 @@ -63,7 +63,7 @@ jobs: steps: - name: Print environment variables run: printenv - + - name: Checkout repository uses: actions/checkout@v3 @@ -111,7 +111,7 @@ jobs: # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: - # The option forces to execute all jobs even though some of them have failed. + # The option forces to execute all jobs even though some of them have failed. fail-fast: false matrix: ${{ fromJson(needs.prepare-matrices.outputs.combined-projects-matrix) }} runs-on: ubuntu-20.04 @@ -171,7 +171,7 @@ jobs: # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: - # The option forces to execute all jobs even though some of them have failed. + # The option forces to execute all jobs even though some of them have failed. fail-fast: false matrix: project: [utbot-core, utbot-fuzzers, utbot-gradle, utbot-junit-contest, utbot-sample] From 7ddfcca3832f030898f6d4ddd5f7d835b9ff1250 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 10:04:03 +0300 Subject: [PATCH 14/19] Remove tab after run --- .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 cab30e8fc2..d166724ee4 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -79,7 +79,7 @@ jobs: chmod +x ./scripts/project/monitoring.sh ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - name: Run tests - run: | + run: | gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }} - name: Upload logs if: ${{ always() }} From 708dc103c5c3a43841a13a133f167ec11ad0b823 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 12:39:06 +0300 Subject: [PATCH 15/19] Remove `echo` --- .github/workflows/build-and-run-tests-from-branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index d166724ee4..2388e905a8 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -44,8 +44,8 @@ jobs: - id: set-matrices name: Read and print config from framework-tests-matrix.json and combined-projects-matrix.json run: | - FRAMEWORK_TESTS=$(echo $(cat .github/workflows/framework-tests-matrix.json)) - COMBINED_PROJECTS=$(echo $(cat .github/workflows/combined-projects-matrix.json)) + FRAMEWORK_TESTS=$(cat .github/workflows/framework-tests-matrix.json) + COMBINED_PROJECTS=$(cat .github/workflows/combined-projects-matrix.json) echo "::set-output name=framework-tests-matrix::$FRAMEWORK_TESTS" echo "::set-output name=combined-projects-matrix::$COMBINED_PROJECTS" echo $FRAMEWORK_TESTS From 4514b93d482fd2b1ca1c3bbab3008414572b4b6e Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:15:51 +0300 Subject: [PATCH 16/19] Remove broking piece with `COMMIT_SHA` --- .github/workflows/build-and-run-tests-from-branch.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 2388e905a8..3633455d29 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -190,9 +190,6 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE} git fetch git checkout ${{ github.event.inputs.commit_sha }} - - uses: actions/checkout@v3 - with: - ref: ${{ env.COMMIT_SHA }} - name: Run monitoring run: | From 98c1a81e92d88050e9b99bf52fa10e2f3ddd9682 Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:17:41 +0300 Subject: [PATCH 17/19] utbot-framework tests -> utbot-framework-test --- .github/workflows/build-and-run-tests-from-branch.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 3633455d29..1bc6f6ec46 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -80,13 +80,13 @@ jobs: ./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }} - name: Run tests run: | - gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }} + gradle --no-daemon :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }} - name: Upload logs if: ${{ always() }} uses: actions/upload-artifact@v3 with: name: logs ${{ matrix.project.PART_NAME }} - path: utbot-framework/logs/* + path: utbot-framework-test/logs/* - name: Upload UTBot temp directory content if: ${{ always() }} @@ -101,7 +101,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test_report ${{ matrix.project.PART_NAME }} - path: utbot-framework/build/reports/tests/test/* + path: utbot-framework-test/build/reports/tests/test/* combined-projects: # This job does not need to wait for 'prepare-tests-matrix' result. From 5a0e6233d08b23720f817d57b5318c8ad93ab27b Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:28:41 +0300 Subject: [PATCH 18/19] Add `echo` --- .github/workflows/build-and-run-tests-from-branch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 1bc6f6ec46..4ae12c81ad 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -44,8 +44,8 @@ jobs: - id: set-matrices name: Read and print config from framework-tests-matrix.json and combined-projects-matrix.json run: | - FRAMEWORK_TESTS=$(cat .github/workflows/framework-tests-matrix.json) - COMBINED_PROJECTS=$(cat .github/workflows/combined-projects-matrix.json) + FRAMEWORK_TESTS=$(echo $(cat .github/workflows/framework-tests-matrix.json)) + COMBINED_PROJECTS=$(echo $(cat .github/workflows/combined-projects-matrix.json)) echo "::set-output name=framework-tests-matrix::$FRAMEWORK_TESTS" echo "::set-output name=combined-projects-matrix::$COMBINED_PROJECTS" echo $FRAMEWORK_TESTS From 38ff09e200dd598a140440d534cdf127e93b795b Mon Sep 17 00:00:00 2001 From: Victoria <32179813+victoriafomina@users.noreply.github.com> Date: Mon, 19 Sep 2022 15:53:46 +0300 Subject: [PATCH 19/19] Remove thing with `COMMIT_SHA` --- .github/workflows/build-and-run-tests-from-branch.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 4ae12c81ad..c16a3bef2b 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -129,9 +129,6 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE} git fetch git checkout ${{ github.event.inputs.commit_sha }} - - uses: actions/checkout@v3 - with: - ref: ${{ env.COMMIT_SHA }} - name: Run monitoring run: |