Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create codacy.yml #2

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run Tests and send coverage

on: [push]

jobs:
build:

runs-on: ubuntu-latest
environment: production

steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean test

- name: Codacy Coverage Reporter
shell: bash
run: |
CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} \
bash <(curl -Ls https://coverage.codacy.com/get.sh) report

1 change: 1 addition & 0 deletions src/test/java/com/codacy/utils/MathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public void shouldAddNumbers() {
Math math = new Math(23);

assertEquals(7, math.magicAdd(3, 4));
assertEquals(8, math.magicAdd(4, 4));
}

// Uncomment this to have 100% coverage
Expand Down
Loading