-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run build and unit test for pull request (#63)
* feat: run build and unit test for pull request * fix: make kube-ratelimiter error
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.17' | ||
|
||
- name: Build | ||
run: make build WHAT="cmd/kube-gateway cmd/kube-ratelimiter" | ||
|
||
- name: Unit Test | ||
run: go test ./... -coverprofile=coverage.out -coverpkg=./... | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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,2 +1,6 @@ | ||
#!/bin/bash | ||
cp -r ${MAKE_RULES_WORKSPACE}/build/kube-ratelimiter/* "${MAKE_RULES_WORKSPACE}/output" | ||
|
||
if [[ -d "${MAKE_RULES_WORKSPACE}/build/kube-ratelimiter/" ]]; then | ||
cp -r ${MAKE_RULES_WORKSPACE}/build/kube-ratelimiter/* "${MAKE_RULES_WORKSPACE}/output" | ||
fi | ||
|