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

Update codecov to check during PR #995

Merged
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
80 changes: 50 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:
branches:
- "*"
- "feature/**"
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- "*"
- "feature/**"
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
Get-CI-Image-Tag:
Expand All @@ -33,16 +32,24 @@ jobs:
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}

steps:
- name: Checkout neural-search
uses: actions/checkout@v1
- name: Run start commands
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}

- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'schedule'

- uses: actions/checkout@v4
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run build
Expand All @@ -51,7 +58,8 @@ jobs:
su `id -un 1000` -c "./gradlew check"

- name: Upload Coverage Report
uses: codecov/codecov-action@v3
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -65,23 +73,24 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Checkout neural-search
uses: actions/checkout@v1
- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'schedule'

- uses: actions/checkout@v4
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run build
run: |
./gradlew check

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

Precommit-neural-search-linux:
needs: Get-CI-Image-Tag
strategy:
Expand All @@ -96,15 +105,24 @@ jobs:
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root
options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}

steps:
- name: Checkout neural-search
uses: actions/checkout@v1
- name: Run start commands
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}

- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'schedule'

- uses: actions/checkout@v4
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run build
Expand All @@ -113,7 +131,8 @@ jobs:
su `id -un 1000` -c "./gradlew precommit --parallel"

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -127,19 +146,20 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Checkout neural-search
uses: actions/checkout@v1
- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'schedule'

- uses: actions/checkout@v4
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run build
run: |
./gradlew precommit --parallel

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
13 changes: 4 additions & 9 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
---
coverage:
# displays different colors depending on below, between, or above the range
range: 50..90
precision: 2
round: down
range: '70...90'
status:
project:
enabled: yes
default:
target: auto
# allows 5% coverage reduction without failing
threshold: 5%
patch: yes
changes: yes

# disable comments in PRs
comment: yes
Loading