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

Add GH action + workflow for setting up Go env in CI #43

Merged
merged 3 commits into from
Jul 17, 2024
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
10 changes: 6 additions & 4 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: 'Build client documentation'
name: 'Generate client documentation'
description: 'Generates client documentation using godoc'

runs:
using: 'composite'
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Write html file to docs directory
shell: bash
run: |
Expand All @@ -13,7 +17,5 @@ runs:
echo "Directory ./docs does not exist. Creating it now..."
mkdir ./docs
fi

# Run the godoc command
godoc -url pkg/github.com/pinecone-io/go-pinecone/pinecone/ > ./docs/index.html
echo "godoc command has been executed and the output has been saved to ./docs/index.html"
echo "godoc command has been executed and the output has been saved to ./docs/index.html"
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Setup Go'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thinking putting this into an action. 👍

description: 'Sets up Go using actions/setup-go@v5'
inputs:
go-version:
description: 'The version of Go to use'
required: true
default: '1.21'

runs:
using: 'composite'
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Install Go dependencies
shell: bash
run: go mod download

- name: Install godoc
shell: bash
run: go install golang.org/x/tools/cmd/godoc@latest
3 changes: 3 additions & 0 deletions .github/workflows/build-and-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: ./.github/actions/setup/action.yml

- name: Generate Go documentation
uses: ./.github/actions/build-docs

Expand Down
Loading