Skip to content

Commit aa3dffb

Browse files
jainadc9jainad
andauthored
Fixed codacy report coverage job failure (#536)
* Fixed codacy report coverage job failure Co-authored-by: jainad <jainad.chinta@ericsson.com>
1 parent b011650 commit aa3dffb

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717
jobs:
1818
# This workflow contains a single job called "build"
19-
unitAndFunctionalTests:
19+
unitAndFunctionalTests:
20+
if: github.repository == 'eiffel-community/eiffel-intelligence'
2021
# The type of runner that the job will run on
2122
runs-on: ubuntu-18.04
2223
env:
@@ -59,6 +60,7 @@ jobs:
5960
mvn test -DskipITs -Dsurefire.rerunFailingTestsCount=2 -Djasypt.encryptor.password=secret -Dspring.config.location=src/functionaltests/resources/application.properties -B
6061
6162
integrationTests:
63+
if: github.repository == 'eiffel-community/eiffel-intelligence'
6264
# The type of runner that the job will run on
6365
runs-on: ubuntu-18.04
6466
env:
@@ -103,6 +105,7 @@ jobs:
103105
mvn verify -DskipUTs -Djasypt.encryptor.password=integrationtest -Dspring.config.location=src/integrationtests/resources/application.properties -B
104106
105107
reportCoverage:
108+
if: github.repository == 'eiffel-community/eiffel-intelligence' && github.event_name == 'push'
106109
# The type of runner that the job will run on
107110
runs-on: ubuntu-18.04
108111
env:
@@ -133,11 +136,14 @@ jobs:
133136
tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
134137
echo "${M2_HOME}/bin" >> $GITHUB_PATH
135138
136-
# Generating test coverage report and publishing to Codacy
137-
- name: Run report coverage
139+
- name: Run cobertura
138140
shell: bash
139141
run: |
140-
mvn --version
141-
mvn cobertura:cobertura -Dcobertura.report.format=xml -B
142-
curl -LSs $(curl -LSs https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r '.assets | map({content_type, browser_download_url} | select(.content_type | contains("application/octet-stream"))) | .[0].browser_download_url') -o codacy-coverage-reporter-assembly.jar
143-
java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/cobertura/coverage.xml
142+
mvn cobertura:cobertura -Dcobertura.report.format=xml -B
143+
144+
# Generating test coverage report and publishing to Codacy
145+
- name: Run report coverage
146+
uses: codacy/codacy-coverage-reporter-action@v1
147+
with:
148+
project-token: 571cdd20d4bf435f84b25d806d304792
149+
coverage-reports: target/site/cobertura/coverage.xml

0 commit comments

Comments
 (0)