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

fix(service/java-client): add support for partial builds using codeco… #52

Merged
merged 2 commits into from
Jul 27, 2023
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
18 changes: 16 additions & 2 deletions .github/workflows/java-client.build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
filters: |
java-client:
- '(ephemeral-java-client|.github)/**'
test:
java-client-test:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.java-client == 'true' }}
Expand Down Expand Up @@ -61,10 +61,24 @@ jobs:
- name: Run Tests
run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress
- name: Collect Jacoco reports
run: echo ::set-output name=reports::$(find . -regex '.*/target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//')
run: echo ::set-output name=reports::$(find . -regex 'target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//')
id: jacoco
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.jacoco.outputs.reports }}
flags: java-client
name: codecov
# This is required to allow for setting the test job as required in scenarios
# where the tests are not actually run, e.g., when the helm chart is updated.
java-client-test-status:
runs-on: ubuntu-22.04
needs: java-client-test
if: '!cancelled()' # Makes the job run regardless whether 'test' succeeds or not but allows for cancellation
steps:
- name: Tests successful
if: ${{ !(contains(needs.java-client-test.result, 'failure')) }}
run: exit 0
- name: Tests failed
if: ${{ contains(needs.java-client-test.result, 'failure') }}
run: exit 1
17 changes: 16 additions & 1 deletion .github/workflows/service.build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
filters: |
service:
- '!((ephemeral-java-client|charts)/**)/**'
test:
service-test:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.service == 'true' }}
Expand Down Expand Up @@ -61,4 +61,19 @@ jobs:
uses: codecov/codecov-action@v3
with:
name: codecov
files: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
flags: service
# This is required to allow for setting the test job as required in scenarios
# where the tests are not actually run, e.g., when the helm chart is updated.
service-test-status:
runs-on: ubuntu-22.04
needs: service-test
if: '!cancelled()' # Makes the job run regardless whether 'test' succeeds or not but allows for cancellation
steps:
- name: Tests successful
if: ${{ !(contains(needs.service-test.result, 'failure')) }}
run: exit 0
- name: Tests failed
if: ${{ contains(needs.service-test.result, 'failure') }}
run: exit 1
13 changes: 13 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
flag_management:
default_rules:
carryforward: true
individual_flags:
- name: java-client
paths:
- ephemeral-java-client/
- name: service
paths:
- cmd/
- pkg/
fixes:
- "((src/)?github\.com/[^\/\n]+/[^\/\n]+/)"
1 change: 0 additions & 1 deletion ephemeral-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<skip.tests>false</skip.tests>
<java.version>1.8</java.version>

Expand Down
Loading