-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: tidy up documentation and github workflows/templates (#29)
- Loading branch information
Showing
11 changed files
with
587 additions
and
315 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- DELETE THIS COMMENT BLOCK | ||
After completing the following: | ||
1. Add a descriptive title `[<Tag>] <DESCRIPTION>` | ||
2. Update _Assignee(s)_ | ||
3. Add _Label(s)_ | ||
--> | ||
|
||
## Summary | ||
|
||
<!-- DELETE THIS COMMENT BLOCK | ||
- Provide a quick summary of the changes yourself | ||
- Let reviewpad summarize your PR under AI summary | ||
- You can leave a `/reviewpad summarize` comment at any time to trigger it manually. | ||
--> | ||
|
||
### Human Summary | ||
|
||
### AI Summary | ||
|
||
reviewpad:summary | ||
|
||
## Issue | ||
|
||
Fixes #<issue_number> | ||
|
||
[Explain the reasoning for the PR in 1-2 sentences. Consider adding a link or a screenshot.] | ||
|
||
## Type of change | ||
|
||
Please mark the relevant option(s): | ||
|
||
- [ ] New feature, functionality or library | ||
- [ ] Bug fix | ||
- [ ] Code health or cleanup | ||
- [ ] Documentation | ||
- [ ] Other (specify) | ||
|
||
|
||
## Testing | ||
|
||
- [ ] **Run all unit tests**: `make test_all` | ||
- [ ] **Run all/relevant benchmarks (if optimising)**: `make benchmark_{all | suite name}` | ||
|
||
<!-- REMOVE this comment block after following the instructions | ||
If you added additional tests or infrastructure, describe it here. | ||
Bonus points for images and videos or gifs. | ||
--> | ||
|
||
## Required Checklist | ||
|
||
- [ ] I have tested my changes using the available tooling | ||
- [ ] I have performed a self-review of my own code | ||
- [ ] I have commented my code ([`godoc` format comments](https://go.dev/blog/godoc) see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) | ||
|
||
### If Applicable Checklist | ||
|
||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] I have updated any relevant README(s)/documentation and left TODOs throughout the codebase | ||
- [ ] Add or update any relevant or supporting [mermaid](https://mermaid-js.github.io/mermaid/) diagrams |
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,74 +7,70 @@ on: | |
- main | ||
- release/** | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Even though we can test against multiple versions, this one is considered a target version. | ||
TARGET_GOLANG_VERSION: "1.20" | ||
TARGET_GOLANG_VERSION: "1.20.11" | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: ["1.20"] | ||
name: Go Tests | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: "0" # Per https://github.com/ignite/cli/issues/1674#issuecomment-1144619147 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Setup Golang caches | ||
uses: actions/cache@v3 | ||
go-version: ${{ env.TARGET_GOLANG_VERSION }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-golang-${{ matrix.go }}- | ||
version: latest | ||
args: --timeout=10m | ||
skip-cache: true | ||
only-new-issues: true | ||
|
||
- name: Create coverage report and run tests | ||
run: | | ||
set -euo pipefail | ||
GODEBUG=netdns=cgo go test -p 1 -json ./ -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic 2>&1 | tee test_results.json | ||
- name: Sanitize test results | ||
# We're utilizing `tee` above which can capture non-json stdout output so we need to remove non-json lines before additional parsing and submitting it to the external github action. | ||
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
run: cat test_results.json | jq -c -R 'fromjson? | select(type == "object")' > tmp.json && mv tmp.json test_results.json | ||
|
||
- name: Output test failures | ||
# Makes it easier to find failed tests so no need to scroll through the whole log. | ||
if: ${{ failure() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
if: ${{ failure() }} | ||
run: | | ||
jq --argjson fail_tests "$(jq -c -r 'select(.Action == "fail") | select(.Test) | .Test' test_results.json | jq -R -s -c -r 'split("\n") | map(select(length>0))')" 'select(.Test as $t | ($fail_tests | arrays)[] | select($t == .)) | select(.Output) | .Output' test_results.json | jq -r | sed ':a;N;$!ba;s/\n\n/\n/g' > test_failures.json | ||
cat test_failures.json | ||
exit 1 | ||
- name: Upload test results | ||
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: | | ||
test_*.json | ||
- name: Annotate tests on GitHub | ||
# Only annotate if the test failed on target version to avoid duplicated annotations on GitHub. | ||
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
uses: guyarb/[email protected] | ||
with: | ||
test-results: test_results.json | ||
|
||
- name: Upload coverage to Codecov | ||
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.txt | ||
- name: golangci-lint | ||
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }} | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout=10m | ||
skip-cache: true | ||
only-new-issues: true | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -83,20 +79,22 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
goarch: ["arm64", "amd64"] | ||
go: ["1.20"] | ||
timeout-minutes: 5 | ||
name: Build for ${{ matrix.goarch }} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
go-version: ${{ env.TARGET_GOLANG_VERSION }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Go build | ||
run: GOOS=linux GOARCH=${{ matrix.goarch }} go build | ||
if: env.GIT_DIFF |
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 +1 @@ | ||
.idea/ | ||
.DS_Store |
Oops, something went wrong.