Skip to content

Docs: Enforce documentation style guide with spelling check and style fixes #9349

Docs: Enforce documentation style guide with spelling check and style fixes

Docs: Enforce documentation style guide with spelling check and style fixes #9349

Workflow file for this run

# Copyright 2019-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Go CI workflow for build, test, and lint.
#
# Do not use workflow-level paths-ignore for required checks.
# GitHub leaves skipped required workflows Pending forever.
# Instead, we always run the workflow and skip individual jobs conditionally.
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetpathspaths-ignore
name: Go
on:
pull_request:
push:
branches:
- '!dependabot/*'
jobs:
# Detect which path groups changed to conditionally skip expensive jobs.
changes:
name: detect changes
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
code:
- 'api/**'
- 'commands/**'
- 'e2e/**'
- 'internal/**'
- 'pkg/**'
- 'mdtogo/**'
- 'scripts/**'
- 'Makefile'
- 'go.mod'
- 'go.sum'
- 'main.go'
- '.github/workflows/go.yml'
build-test:
name: build-test-${{ matrix.runtime }}
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runtime: [docker, podman]
steps:
- name: Check runtime
if: ${{ matrix.runtime == 'podman' }}
run: |
which podman
podman version
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build, Test, Lint
run: |
git config --global user.email you@example.com
git config --global user.name Your Name
make all
make test-docker
env:
KRM_FN_RUNTIME: ${{ matrix.runtime }}
build-macos:
name: build-macos
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: |
make build
go-gate:
name: go
needs: [changes, build-test, build-macos]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
# If no code changes, this check is not applicable, pass.
if [ "${{ needs.changes.result }}" != "success" ]; then
echo "changes job did not succeed"
exit 1
fi
if [ "${{ needs.changes.outputs.code }}" = "false" ]; then
echo "No code changes, skipping Go tests"
exit 0
fi
# If any required job failed, cancelled, or skipped, fail this check.
if [ "${{ needs.build-test.result }}" != "success" ] || \
[ "${{ needs.build-macos.result }}" != "success" ]; then
echo "Go tests failed or did not complete"
exit 1
fi
echo "Go tests passed"