mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 3 to 4. - [Release notes](https://github.com/dorny/paths-filter/releases) - [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md) - [Commits](https://github.com/dorny/paths-filter/compare/v3...v4) --- updated-dependencies: - dependency-name: dorny/paths-filter dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
159 lines
4.5 KiB
YAML
159 lines
4.5 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
## TODO: conditional-changes checker is not working
|
|
conditional-changes:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
outputs:
|
|
doc: ${{ steps.filter.outputs.doc }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dorny/paths-filter@v4
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
doc:
|
|
- 'site/**'
|
|
|
|
check-modules:
|
|
name: check-synced-go-modules
|
|
# needs: conditional-changes
|
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache: true
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
id: go
|
|
- name: sync go modules
|
|
run: make workspace-sync
|
|
- name: check for changes with 'make workspace-sync'
|
|
run: git diff --exit-code
|
|
|
|
lint:
|
|
name: Lint
|
|
# needs: conditional-changes
|
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache: true
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
id: go
|
|
- name: Lint
|
|
run: make lint
|
|
- name: Verify boilerplate
|
|
run: make check-license
|
|
|
|
## Test all modules without plugins and released modules
|
|
test-non-released-modules:
|
|
name: Test Linux
|
|
# needs: conditional-changes
|
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache: true
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
id: go
|
|
- name: Test all modules without plugins and released modules
|
|
run: make test-unit-non-plugin-and-non-released
|
|
env:
|
|
KUSTOMIZE_DOCKER_E2E: true
|
|
|
|
test-modules:
|
|
name: Test ${{ matrix.os }} - ${{ matrix.module }}
|
|
# needs: conditional-changes
|
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
module:
|
|
- kyaml
|
|
- cmd/config
|
|
- api
|
|
- kustomize
|
|
include:
|
|
- module: kyaml
|
|
test-cmd: go test -race -v -cover ./...
|
|
- module: cmd/config
|
|
test-cmd: go test -v -cover ./...
|
|
- module: api
|
|
test-cmd: go test -v -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-01-31T23:38:41Z -X sigs.k8s.io/kustomize/api/provenance.version=(test)"
|
|
- module: kustomize
|
|
test-cmd: go test -v -cover ./...
|
|
- os: ubuntu-latest
|
|
docker-e2e: true
|
|
- os: macos-latest
|
|
docker-e2e: false
|
|
- os: windows-latest
|
|
docker-e2e: false
|
|
env:
|
|
KUSTOMIZE_DOCKER_E2E: ${{ matrix.docker-e2e }}
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache: true
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
id: go
|
|
- name: Test ${{ matrix.module }}
|
|
run: ${{ matrix.test-cmd }}
|
|
# TODO (#4001): replace specific modules above with this once Windows tests are passing.
|
|
if: ${{ !(matrix.os == 'windows-latest' && (matrix.module == 'api' || matrix.module == 'kustomize')) }}
|
|
working-directory: ./${{ matrix.module }}
|
|
|
|
# Aggregation matrix tests from test-modules for branch protection rules
|
|
test-modules-summary:
|
|
name: Test Summary
|
|
runs-on: ubuntu-latest
|
|
needs: test-modules
|
|
if: always()
|
|
steps:
|
|
- name: Check test results
|
|
run: |
|
|
if [[ "${{ needs.test-modules.result }}" != "success" ]]; then
|
|
echo "Some tests failed or were cancelled"
|
|
exit 1
|
|
fi
|
|
echo "All tests passed successfully"
|