diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index e0740d1e..5c73d6cd 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -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 + template_file: CONTRIBUTING.template.md + test: uses: ./.github/workflows/test.yml secrets: diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml index eaf4c8e8..ef753ed4 100644 --- a/.github/workflows/on-push-to-main.yml +++ b/.github/workflows/on-push-to-main.yml @@ -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] diff --git a/CONTRIBUTING.template.md b/CONTRIBUTING.template.md new file mode 100644 index 00000000..5c2c4005 --- /dev/null +++ b/CONTRIBUTING.template.md @@ -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 }}