Skip to content

Commit

Permalink
fix: github actions to move code coverage to PR check
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishekvrshny committed Dec 25, 2024
1 parent 273e285 commit 16c519c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
34 changes: 1 addition & 33 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- chore/badge

jobs:
build-and-push:
Expand All @@ -18,41 +17,11 @@ jobs:
with:
go-version: stable
cache: true

- name: Run Test
run: |
make test
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage-summary.out
target: Readme.md

- name: Check for README Changes
uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: Readme.md

- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Readme.md
git commit -m "chore: Updated coverage badge."
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref_name }}

- name: Build Go Application
run: go build -v ./...

run: make build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
Expand All @@ -62,7 +31,6 @@ jobs:
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Log in to Quay.io
uses: docker/login-action@v2
with:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ jobs:
- name: Run Tests
run: |
make test
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage-summary.out
target: Readme.md
- name: Check for README Changes
uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: Readme.md
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Readme.md
git commit -m "chore: Updated coverage badge."
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref_name }}
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion rpc/push/v1/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16c519c

Please sign in to comment.