Add a basic test for resourcedocsgen #1
Workflow file for this run
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
name: "Check Go" | |
on: | |
workflow_call: | |
inputs: | |
path: | |
required: true | |
type: string | |
description: | | |
The file path from the root of the repo to the go code to check. For example: | |
tools/resourcedocsgen/ | |
Path should be the root of a go module. | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
${{ inputs.path }} | |
.golangci.yml | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.61 | |
working-directory: ${{ inputs.path }} | |
args: --config $GITHUB_WORKSPACE/.golangci.yml | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
${{ inputs.path }} | |
.golangci.yml | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
- name: go-test | |
- run: | | |
cd $GITHUB_WORKSPACE/${{ inputs.path }} | |
go test ./... -v |