Skip to content

Commit

Permalink
Merge pull request #159 from crossoverJie/upgrade-codecov
Browse files Browse the repository at this point in the history
Upgrade-codecov
  • Loading branch information
crossoverJie authored Sep 22, 2024
2 parents 9e94b66 + 5d9bdbe commit f080cbe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ vars.CODECOV_TOKEN }}
uses: ./.github/workflows/reusable_run_tests.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/reusable_run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: A reusable workflow to build and run the unit test suite

on:
workflow_call:
secrets:
codecov_token:
required: true

jobs:
build_and_test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit f080cbe

Please sign in to comment.