-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
204 additions
and
84 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2023-Present The UDS Authors | ||
|
||
includes: | ||
- test: tasks/tests.yaml | ||
- schema: tasks/schema.yaml | ||
|
||
variables: | ||
- name: K9S_VERSION | ||
- name: CRANE_VERSION | ||
- name: SYFT_VERSION | ||
- name: ARCHIVER_VERSION | ||
- name: HELM_VERSION | ||
- name: CLI_VERSION | ||
- name: BUILD_ARGS | ||
|
||
tasks: | ||
# build tasks | ||
- name: get-versions | ||
description: gets versions of UDS CLI + vendored tools | ||
actions: | ||
- cmd: go list -f '{{.Version}}' -m github.com/derailed/k9s | ||
setVariables: | ||
- name: K9S_VERSION | ||
- cmd: go list -f '{{.Version}}' -m github.com/anchore/syft | ||
setVariables: | ||
- name: SYFT_VERSION | ||
- cmd: go list -f '{{.Version}}' -m github.com/google/go-containerregistry | ||
setVariables: | ||
- name: CRANE_VERSION | ||
- cmd: go list -f '{{.Version}}' -m github.com/mholt/archiver/v3 | ||
setVariables: | ||
- name: ARCHIVER_VERSION | ||
- cmd: go list -f '{{.Version}}' -m helm.sh/helm/v3 | ||
setVariables: | ||
- name: HELM_VERSION | ||
- cmd: git describe --tags 2>/dev/null || echo "UnknownVersion" | ||
setVariables: | ||
- name: CLI_VERSION | ||
|
||
- name: build-args | ||
description: generates the build args for building UDS CLI | ||
actions: | ||
- cmd: | | ||
cat <<EOF | ||
-s -w -X 'github.com/defenseunicorns/uds-cli/src/config.CLIVersion=${CLI_VERSION}' \ | ||
-X 'github.com/defenseunicorns/zarf/src/config.ActionsCommandZarfPrefix=zarf' \ | ||
-X 'github.com/derailed/k9s/cmd.version=${K9S_VERSION}' \ | ||
-X 'github.com/google/go-containerregistry/cmd/crane/cmd.Version=${CRANE_VERSION}' \ | ||
-X 'github.com/defenseunicorns/zarf/src/cmd/tools.syftVersion=${SYFT_VERSION}' \ | ||
-X 'github.com/defenseunicorns/zarf/src/cmd/tools.archiverVersion=${ARCHIVER_VERSION}' \ | ||
-X 'github.com/defenseunicorns/zarf/src/cmd/tools.helmVersion=${HELM_VERSION}' | ||
EOF | ||
setVariables: | ||
- name: BUILD_ARGS | ||
- name: build-cli-linux-amd | ||
description: build the CLI for Linux AMD64 | ||
actions: | ||
- task: get-versions | ||
- task: build-args | ||
- cmd: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="${BUILD_ARGS}" -o build/uds main.go | ||
|
||
- name: build-cli-linux-arm | ||
description: build the CLI for Linux ARM64 | ||
actions: | ||
- task: get-versions | ||
- task: build-args | ||
- cmd: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="${BUILD_ARGS}" -o build/uds-arm main.go | ||
|
||
- name: build-cli-mac-intel | ||
description: build the CLI for Mac Intel | ||
actions: | ||
- task: get-versions | ||
- task: build-args | ||
- cmd: GOOS=darwin GOARCH=amd64 go build -ldflags="${BUILD_ARGS}" -o build/uds-mac-intel main.go | ||
|
||
- name: build-cli-mac-apple | ||
description: build the CLI for Mac Apple | ||
actions: | ||
- task: get-versions | ||
- task: build-args | ||
- cmd: GOOS=darwin GOARCH=arm64 go build -ldflags="${BUILD_ARGS}" -o build/uds-mac-apple main.go |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2023-Present The UDS Authors | ||
|
||
tasks: | ||
- name: lint | ||
description: runs the linter (requires golangci-lint) | ||
actions: | ||
- cmd: golangci-lint run ./src/... | ||
|
||
- name: clean | ||
description: removes the build dir | ||
actions: | ||
- cmd: rm -rf build | ||
|
||
- name: local-registry | ||
description: run a local docker registry | ||
actions: | ||
- cmd: | | ||
docker run -p 5000:5000 --restart=always --name registry registry:2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2023-Present The UDS Authors | ||
|
||
tasks: | ||
- name: schema | ||
description: updates the JSON schema | ||
actions: | ||
- cmd: ./hack/generate-schema.sh | ||
|
||
- name: test-schema | ||
description: tests if the schema has been modified | ||
actions: | ||
- cmd: ./uds run schema | ||
- cmd: ./hack/test-generate-schema.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2023-Present The UDS Authors | ||
|
||
tasks: | ||
- name: test-unit | ||
description: run all the unit tests | ||
actions: | ||
- cmd: cd src/pkg && go test ./... -failfast -v -timeout 5m | ||
|
||
- name: test-e2e | ||
description: run all the e2e tests | ||
actions: | ||
- cmd: cd src/test/e2e && go test -failfast -v -timeout 30m | ||
|
||
- name: test-e2e-no-ghcr-write | ||
description: run e2e tests without writing to GHCR | ||
actions: | ||
- cmd: cd src/test/e2e && go test -failfast -v -timeout 30m -skip ".*GHCR.*" | ||
|
||
- name: test-e2e-ghcr | ||
description: run e2e tests that write to GHCR | ||
actions: | ||
- cmd: cd src/test/e2e && go test -failfast -v -timeout 30m -run ".*GHCR.*" | ||
|
||
- name: test-e2e-runner | ||
description: run e2e tests for task runner only | ||
actions: | ||
- cmd: cd src/test/e2e && go test -failfast -v -timeout 30m -run TestTaskRunner | ||
|
||
- name: push-test-artifacts | ||
description: push artifacts that UDS CLI tests rely on to GHCR | ||
actions: | ||
- cmd: ./hack/push-test-artifacts.sh | ||
|
||
- name: clean-test-artifacts | ||
description: removes bundles and zarf packages that have been created from previous test runs | ||
actions: | ||
- cmd: find src/test -type f -name '*.tar.zst' -delete |
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