-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: github actions to move code coverage to PR check
- Loading branch information
1 parent
273e285
commit 16c519c
Showing
3 changed files
with
25 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: | ||
- main | ||
- chore/badge | ||
|
||
jobs: | ||
build-and-push: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.