-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Haraj-backend/chore/use-coveralls
Chore: Use Coveralls
- Loading branch information
Showing
8 changed files
with
18 additions
and
167 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 |
---|---|---|
|
@@ -7,61 +7,8 @@ on: | |
- 'docs/**' | ||
|
||
jobs: | ||
preparation: | ||
name: Determine Changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
exec-tests: ${{ (steps.changes.outputs.exec-tests == 'true') }} | ||
steps: | ||
- name: Checkout Current Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Determine Changes | ||
uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | | ||
exec-tests: | ||
- ".github/workflows/**" | ||
- "internal/**" | ||
- "build/**" | ||
- "cmd/**" | ||
- "deploy/**" | ||
- "go.mod" | ||
- "go.sum" | ||
- "Makefile" | ||
build-all: | ||
name: Test Build All Container Images | ||
needs: preparation | ||
if: needs.preparation.outputs.exec-tests == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Current Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Build All | ||
run: make test-build-all | ||
|
||
- name: Notify To Slack If Failed | ||
uses: lazy-actions/[email protected] | ||
if: failure() | ||
with: | ||
type: ${{ job.status }} | ||
job_name: "*[hex-monscape]* ${{ github.job }}" | ||
mention: "here" | ||
mention_if: "failure" | ||
channel: "#solutions-team-ci-cd" | ||
icon_emoji: ":haraaj:" | ||
username: "ci/cd-reporter" | ||
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }} | ||
commit: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
run-tests: | ||
name: Run Automated Tests | ||
needs: preparation | ||
if: needs.preparation.outputs.exec-tests == 'true' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -72,6 +19,9 @@ jobs: | |
- name: Run Automated Tests | ||
run: make test | ||
|
||
- name: Test Build All Container Images | ||
run: make test-build-all | ||
|
||
- name: Notify To Slack If Failed | ||
uses: lazy-actions/[email protected] | ||
if: failure() | ||
|
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 |
---|---|---|
|
@@ -10,40 +10,20 @@ on: | |
- master | ||
|
||
jobs: | ||
gen-badge: | ||
name: Generate Coverage Badge | ||
update-badge: | ||
name: Update Coverage Badge | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout Current Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate Coverage Report | ||
run: make test | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
|
||
- name: Install gobadge | ||
run: go install github.com/AlexBeauchemin/gobadge@latest | ||
|
||
- name: Generate Coverage Badge | ||
run: | | ||
# generate coverage badge | ||
gobadge \ | ||
-filename=./.output/cov-report/coverage.out \ | ||
-green=80 \ | ||
-target=README.md \ | ||
-text=coverage \ | ||
-link=./.output/cov-report/coverage.out | ||
- name: Auto Commit & Push Coverage Badge | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
id: auto-commit-action | ||
- name: Send Coverage Report to Coveralls | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
commit_message: "chore: update coverage report & apply coverage badge to README.md" | ||
file_pattern: 'README.md .output/cov-report/coverage.out' | ||
path-to-profile: ./.output/cov-report/profile.cov | ||
|
||
- name: Notify To Slack If Failed | ||
uses: lazy-actions/[email protected] | ||
|
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
* | ||
!.gitignore | ||
!cov-report/ | ||
!cov-report/* | ||
!README.md |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# About `.output` Directory | ||
|
||
This directory is used for storing any output files generated from deployment & test commands specified in the [Makefile](../Makefile). This includes: | ||
|
||
- go modules cache when running the `make run*` command | ||
- server build result when running the `make run*` command | ||
- test coverage reports when running the `make test` command |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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