Skip to content

Commit

Permalink
feat: add pull request codecov (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardseptember authored May 28, 2024
1 parent c3fe93f commit c50e075
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 6 deletions.
82 changes: 76 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,55 @@ on:
schedule:
- cron: '0 9 * * *'
jobs:
test:
JDK8:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
JDK17:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
JDK17:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
JDK8-master:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
Expand All @@ -28,8 +76,30 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -B -U --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
JDK17-master:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
JDK21-master:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml
33 changes: 33 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "master" ]
schedule:
- cron: '0 9 * * *'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -B -U --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
pull_request_target:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn clean install -B -U --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit c50e075

Please sign in to comment.