Skip to content

Commit

Permalink
chore: tidy up documentation and github workflows/templates (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law authored Dec 2, 2023
1 parent 1c504f4 commit 0278e35
Show file tree
Hide file tree
Showing 11 changed files with 587 additions and 315 deletions.
65 changes: 32 additions & 33 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,40 @@
name: Issue
about: General purpose issue for the SMT libarary
title: "[REPLACE ME] With a descriptive title"
labels: ''
assignees: ''

labels: ""
assignees: ""
---

<!-- DELETE ME after following these instructions
1. Make sure to update the _Assigness_, _Labels_, _Projects_, _Milestone_ before submitting the issue\_
2. Make sure to add labels for the purpose (e.g. `enhancement`, `bug`) and priority (e.g. `low`) of this PR\_
<!-- DELETE THIS COMMENT BLOCK
After completing the following:
1. Update _Assignee(s)_
2. Add _Label(s)_
-->

## Objective

[ What? Issue description]
[ What? Describe the issue in 1-2 sentences]

## Origin Document

[ Why? Issue justification and/or link to another document]
[ Why? Justify the issue in 1-2 sentences. Consider adding a link or a screenshot.]

## Goals

<!-- REMOVE this comment block after following the instructions
Make a list of high level tasks, ideas or goals driving the task. These should not be actionable deliverables.
<!-- DELETE THIS COMMENT BLOCK
Provide a list of goals (not tasks) driving this issue.
These should not be actionable but guide the overarching goals we're aiming to achieve.
-->

- Goal #1
- Goal #2
- ...

## Deliverable
## Deliverables

<!-- REMOVE this comment block after following the instructions
Make a list of deliverables that are expected outputs of this task. These should be concrete and tangible.
<!-- DELETE THIS COMMENT BLOCK
Make a list of deliverables that must be done to consider this task/issue resolved.
These should be very actionable, concrete and tangible.
-->

- [ ] Deliverable #1
Expand All @@ -42,34 +44,31 @@ assignees: ''

## Non-goals / Non-deliverables

<!-- REMOVE this comment block after following the instructions
Make a list goals and deliverables the assignee of the issue should not attempt to do so the scope does not become too large.
<!-- DELETE THIS COMMENT BLOCK
Make a list of action items that are out of scope for this issue.
These should explicitly not be delivered as part of this issue and should be considered scope creep.
-->

- Nongoal #1
- Nongoal #2
- Non-goal #1
- Non-deliverable #2
- ...

## General issue deliverables
## General deliverables

<!-- REMOVE this comment block after following the instructions
Remove any items that are not applicable and add additional ones, if applicable, that are not listed below.
<!-- DELETE THIS COMMENT BLOCK
Remove sections that are not applicable to this PR.
-->

- [ ] Update any relevant README(s)
- [ ] Add or update any relevant or supporting [mermaid](https://mermaid-js.github.io/mermaid/) diagrams
- [ ] **Comments**: Add/update TODOs and comments alongside the source code so it is easier to follow.
- [ ] **Testing**: Add new tests (unit/fuzz/benchmarks) to the test suite.
- [ ] **Makefile**: Add new targets to the Makefile to make the new functionality easier to use.
- [ ] **Documentation**: Update architectural or development READMEs; use [mermaid](https://mermaid-js.github.io/mermaid/) diagrams where appropriate.

## Testing Methodology
---

<!-- REMOVE this comment block after following the instructions
Remove this section if not applicable. Otherwise, update (add/remove) the list below as deemed necessary.
<!-- DELETE THIS COMMENT BLOCK
Remove `Co-Owners` if not applicable.
-->

- [ ] **Task specific tests or benchmarks**: `go test ...`
- [ ] **New tests or benchmarks**: `go test ...`
- [ ] **All tests**: `go test -v`

---

**Creator**: [github username of the creator]
**Co-Owners**: [optional - github usernames of the co-owner(s)]
**Creator**: [GitHub handle of issue owner]
**Co-Owners**: [OPTIONAL - GitHub handle of co-owner(s)]
65 changes: 0 additions & 65 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

59 changes: 59 additions & 0 deletions .github/pull_request_template.md
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
60 changes: 29 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.idea/
.DS_Store
Loading

0 comments on commit 0278e35

Please sign in to comment.