Skip to content

Commit 5769e9a

Browse files
viktoriia-fominaEgorkaKulikov
authored andcommitted
Add utbot-framework-test to actions
1 parent 19543ab commit 5769e9a

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

.github/workflows/build-and-run-tests-from-branch.yml

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
steps:
3131
- name: Print environment variables
3232
run: printenv
33-
33+
3434
- name: Checkout repository
3535
uses: actions/checkout@v3
36-
36+
3737
- name: Check out ${{ github.event.inputs.commit_sha }} commit
3838
if: github.event.inputs.commit_sha != ''
3939
run: |
@@ -45,101 +45,101 @@ jobs:
4545
TASKS=$(echo $(cat .github/workflows/framework-tests-matrix.json))
4646
echo "::set-output name=matrix::$TASKS"
4747
echo $TASKS
48-
framework:
48+
framework-test:
4949
# This job does not need to wait for 'prepare-tests-matrix' result.
50-
# GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
50+
# GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them
5151
# to start execution early.
5252
needs: prepare-tests-matrix
53-
# Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
53+
# Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
5454
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
5555
strategy:
56-
# The option forces to execute all jobs even though some of them have failed.
56+
# The option forces to execute all jobs even though some of them have failed.
5757
fail-fast: false
5858
matrix: ${{ fromJson(needs.prepare-tests-matrix.outputs.matrix) }}
5959
runs-on: ubuntu-20.04
6060
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
6161
steps:
62-
- name: Print environment variables
63-
run: printenv
64-
65-
- name: Checkout repository
66-
uses: actions/checkout@v3
62+
- name: Print environment variables
63+
run: printenv
6764

68-
- name: Check out ${{ github.event.inputs.commit_sha }} commit
69-
if: github.event.inputs.commit_sha != ''
70-
run: |
71-
git fetch
72-
git checkout ${{ github.event.inputs.commit_sha }}
73-
- name: Run monitoring
74-
run: |
75-
echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
76-
chmod +x ./scripts/project/monitoring.sh
77-
./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
78-
- name: Run tests
79-
run: |
80-
gradle --no-daemon :utbot-framework:test ${{ matrix.project.TESTS_TO_RUN }}
81-
- name: Upload logs
82-
if: ${{ always() }}
83-
uses: actions/upload-artifact@v3
84-
with:
85-
name: logs ${{ matrix.project.PART_NAME }}
86-
path: utbot-framework/logs/*
65+
- name: Checkout repository
66+
uses: actions/checkout@v3
8767

88-
- name: Upload UTBot temp directory content
89-
if: ${{ always() }}
90-
uses: actions/upload-artifact@v3
91-
with:
92-
name: utbot_temp ${{ matrix.project.PART_NAME }}
93-
path: |
94-
/tmp/UTBot/generated*/*
95-
/tmp/UTBot/utbot-childprocess-errors/*
96-
- name: Upload test report if tests have failed
97-
if: ${{ failure() }}
98-
uses: actions/upload-artifact@v3
99-
with:
100-
name: test_report ${{ matrix.project.PART_NAME }}
101-
path: utbot-framework/build/reports/tests/test/*
68+
- name: Check out ${{ github.event.inputs.commit_sha }} commit
69+
if: github.event.inputs.commit_sha != ''
70+
run: |
71+
git fetch
72+
git checkout ${{ github.event.inputs.commit_sha }}
73+
- name: Run monitoring
74+
run: |
75+
echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
76+
chmod +x ./scripts/monitoring.sh
77+
./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
78+
- name: Run tests
79+
run: |
80+
gradle --no-daemon :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }}
81+
- name: Upload logs
82+
if: ${{ always() }}
83+
uses: actions/upload-artifact@v3
84+
with:
85+
name: logs ${{ matrix.project.PART_NAME }}
86+
path: utbot-framework-test/logs/*
87+
88+
- name: Upload UTBot temp directory content
89+
if: ${{ always() }}
90+
uses: actions/upload-artifact@v3
91+
with:
92+
name: utbot_temp ${{ matrix.project.PART_NAME }}
93+
path: |
94+
/tmp/UTBot/generated*/*
95+
/tmp/UTBot/utbot-childprocess-errors/*
96+
- name: Upload test report if tests have failed
97+
if: ${{ failure() }}
98+
uses: actions/upload-artifact@v3
99+
with:
100+
name: test_report ${{ matrix.project.PART_NAME }}
101+
path: utbot-framework-test/build/reports/tests/test/*
102102

103103

104104
project:
105105
needs: prepare-tests-matrix
106-
# Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
106+
# Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
107107
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
108108
strategy:
109-
# The option forces to execute all jobs even though some of them have failed.
109+
# The option forces to execute all jobs even though some of them have failed.
110110
fail-fast: false
111111
matrix:
112-
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-rd, utbot-sample, utbot-summary, utbot-summary-tests]
112+
project: [utbot-api, utbot-cli, utbot-core, utbot-framework, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-instrumentation, utbot-instrumentation-tests, utbot-intellij, utbot-junit-contest, utbot-rd, utbot-sample, utbot-summary, utbot-summary-tests]
113113
runs-on: ubuntu-20.04
114114
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
115115
steps:
116-
- name: Print environment variables
117-
run: printenv
116+
- name: Print environment variables
117+
run: printenv
118118

119-
- name: Checkout repository
120-
uses: actions/checkout@v3
119+
- name: Checkout repository
120+
uses: actions/checkout@v3
121121

122-
- name: Check out ${{ github.event.inputs.commit_sha }} commit
123-
if: github.event.inputs.commit_sha != ''
124-
run: |
125-
git fetch
126-
git checkout ${{ github.event.inputs.commit_sha }}
127-
- uses: actions/checkout@v3
128-
with:
129-
ref: ${{ env.COMMIT_SHA }}
122+
- name: Check out ${{ github.event.inputs.commit_sha }} commit
123+
if: github.event.inputs.commit_sha != ''
124+
run: |
125+
git fetch
126+
git checkout ${{ github.event.inputs.commit_sha }}
127+
- uses: actions/checkout@v3
128+
with:
129+
ref: ${{ env.COMMIT_SHA }}
130130

131-
- name: Run monitoring
132-
run: |
133-
echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
134-
chmod +x ./scripts/project/monitoring.sh
135-
./scripts/project/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
136-
- name: Run tests
137-
run: |
138-
cd ${{ matrix.project }}
139-
gradle build --no-daemon
140-
- name: Upload test report if tests have failed
141-
if: ${{ failure() }}
142-
uses: actions/upload-artifact@v3
143-
with:
144-
name: test_report ${{ matrix.project }}
145-
path: ${{ matrix.project }}/build/reports/tests/test/*
131+
- name: Run monitoring
132+
run: |
133+
echo Find your Prometheus metrics using label {instance=\"${GITHUB_RUN_ID}-${HOSTNAME}\"}
134+
chmod +x ./scripts/monitoring.sh
135+
./scripts/monitoring.sh ${{ secrets.PUSHGATEWAY_HOSTNAME }} ${{ secrets.PUSHGATEWAY_USER }} ${{ secrets.PUSHGATEWAY_PASSWORD }}
136+
- name: Run tests
137+
run: |
138+
cd ${{ matrix.project }}
139+
gradle build --no-daemon
140+
- name: Upload test report if tests have failed
141+
if: ${{ failure() }}
142+
uses: actions/upload-artifact@v3
143+
with:
144+
name: test_report ${{ matrix.project }}
145+
path: ${{ matrix.project }}/build/reports/tests/test/*

0 commit comments

Comments
 (0)