Skip to content

Commit 96b1072

Browse files
Merge pull request #2 from DMarinhoCodacy/create-codacy-yaml
Create codacy.yml
2 parents 8fcb70d + ff6318d commit 96b1072

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/codacy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run Tests and send coverage
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
environment: production
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up JDK
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: '8'
17+
distribution: 'temurin'
18+
cache: maven
19+
- name: Test with Maven
20+
run: mvn clean test
21+
22+
- name: Codacy Coverage Reporter
23+
shell: bash
24+
run: |
25+
CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} \
26+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report
27+

src/test/java/com/codacy/utils/MathTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public void shouldAddNumbers() {
1010
Math math = new Math(23);
1111

1212
assertEquals(7, math.magicAdd(3, 4));
13+
assertEquals(8, math.magicAdd(4, 4));
1314
}
1415

1516
// Uncomment this to have 100% coverage

0 commit comments

Comments
 (0)