Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add a CONTRIBUTING template. #112

Merged
merged 5 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ jobs:
sdk_language: Go
usage_example_path: ./examples/main.go

- name: Verify CONTRIBUTING generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v1
with:
project_status: official
project_stability: alpha
project_type: other
sdk_language: Go
schwern marked this conversation as resolved.
Show resolved Hide resolved
template_file: CONTRIBUTING.template.md

test:
uses: ./.github/workflows/test.yml
secrets:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ jobs:
project_type: sdk
sdk_language: Go
usage_example_path: ./examples/main.go

- name: Generate CONTRIBUTING
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v1
with:
project_status: official
project_stability: alpha
project_type: other
sdk_language: Go
template_file: CONTRIBUTING.template.md

test:
needs: [readme]
Expand Down
44 changes: 44 additions & 0 deletions CONTRIBUTING.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ ossHeader }}

# Welcome to client-sdk-go contributing guide :wave:

Thank you for taking your time to contribute to our Go SDK!
This guide will provide you information to start your own development and testing.
Happy coding :dancer:

## Submitting

If you've found a bug, or have a suggestion, please [open an issue in our project](https://github.com/momentohq/client-sdk-go/issues).

If you want to submit a change, please [submit a pull request to our project](https://github.com/momentohq/client-sdk-go/pulls). Use the normal [Github pull request process](https://docs.github.com/en/pull-requests). Please run `make precommit` before submitting your pull request; see below for more information.

## Minimum Go version

Our minimum supported Go version is currently `1.19`. You can download it from [go.dev](https://go.dev/).

## Requirements

To make development easier, we provide a [Makefile](https://golangdocs.com/makefiles-golang) to do common development tasks. If you're on Windows, you can get `make` by installing [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) (WSL).

## First-time setup :wrench:

Run `make install-devtools`. This will install...

* [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports)
* [staticcheck](https://staticcheck.io/)

## Developing :computer:

Running `make precommit` will run all formatters, linters, and the tests. Run this before submitting a PR to ensure the code passes tests and follows our project conventions.

* `make test` will just run the tests
* `make lint` will just run the formatting and linters

## Tests :zap:

Integration tests require an auth token for testing. Set the env var `TEST_AUTH_TOKEN` to
provide it, you can get this from your `~/.momento/credentials` file. The env `TEST_CACHE_NAME` is also required, but for now any string value works.

Then run `make test`.

{{ ossFooter }}