Skip to content

Add a basic test for resourcedocsgen #1

Add a basic test for resourcedocsgen

Add a basic test for resourcedocsgen #1

Workflow file for this run

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