Skip to content

Bump github.com/google/ko from 0.18.1 to 0.19.0 in /hack/ko #1232

Bump github.com/google/ko from 0.18.1 to 0.19.0 in /hack/ko

Bump github.com/google/ko from 0.18.1 to 0.19.0 in /hack/ko #1232

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
- '!dependabot/**'
tags:
# semver tags
- 'v[0-9]+\.[0-9]+\.[0-9]+-?**'
pull_request: {}
jobs:
tools:
# Synthetic job to host config anchors referenced by other jobs.
# Running this job does no meaningful work, but would pass.
name: Build and cache tools
runs-on: ubuntu-latest
if: false
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: '**/*.sum'
- parallel:
- &install-controller-gen
name: Install controller-gen
uses: reconcilerio/go-install-action@v1
with:
package: sigs.k8s.io/controller-tools/cmd/controller-gen
working-directory: hack/controller-gen
download-url-template: https://github.com/kubernetes-sigs/controller-tools/releases/download/${version}/controller-gen-${os}-${arch}
output-path-env: CONTROLLER_GEN
toolchain: auto
- &install-crane
name: Install crane
uses: reconcilerio/install-crane-action@v1
with:
version: v0.21.5
- &install-diegen
name: Install diegen
uses: reconcilerio/go-install-action@v1
with:
package: reconciler.io/dies/diegen
working-directory: hack/diegen
download-url-template: https://github.com/reconcilerio/dies/releases/download/${version}/diegen-${os}-${arch}
output-path-env: DIEGEN
toolchain: auto
- &install-goimports
name: Install goimports
uses: reconcilerio/go-install-action@v1
with:
package: golang.org/x/tools/cmd/goimports
working-directory: hack/goimports
output-path-env: GOIMPORTS
toolchain: auto
- &install-imgpkg
name: Install imgpkg
uses: reconcilerio/go-install-action@v1
with:
package: carvel.dev/imgpkg/cmd/imgpkg
working-directory: hack/imgpkg
download-url-template: https://github.com/carvel-dev/imgpkg/releases/download/${version}/imgpkg-${os}-${arch}
output-path-env: IMGPKG
toolchain: auto
- &install-kapp
name: Install kapp
uses: reconcilerio/go-install-action@v1
with:
package: carvel.dev/kapp/cmd/kapp
working-directory: hack/kapp
download-url-template: https://github.com/carvel-dev/kapp/releases/download/${version}/kapp-${os}-${arch}
output-path-env: KAPP
toolchain: auto
- &install-kbld
name: Install kbld
uses: reconcilerio/go-install-action@v1
with:
package: carvel.dev/kbld/cmd/kbld
working-directory: hack/kbld
download-url-template: https://github.com/carvel-dev/kbld/releases/download/${version}/kbld-${os}-${arch}
output-path-env: KBLD
toolchain: auto
- &install-ko
name: Install ko
uses: reconcilerio/go-install-action@v1
with:
package: github.com/google/ko
working-directory: hack/ko
download-url-template: https://github.com/ko-build/ko/releases/download/${version}/ko_${version:1}_${os^}_${arch/amd64/x86_64}.tar.gz
download-path-within-archive: ko
output-path-env: KO
toolchain: auto
- &install-kustomize
name: Install kustomize
uses: reconcilerio/go-install-action@v1
with:
package: sigs.k8s.io/kustomize/kustomize/v4
working-directory: hack/kustomize
download-url-template: https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${version}/kustomize_${version}_${os}_${arch}.tar.gz
download-path-within-archive: kustomize
output-path-env: KUSTOMIZE
toolchain: auto
- &install-yq
name: Install yq
uses: reconcilerio/go-install-action@v1
with:
package: github.com/mikefarah/yq/v4
working-directory: hack/yq
download-url-template: https://github.com/mikefarah/yq/releases/download/${version}/yq_${os}_${arch}
output-path-env: YQ
toolchain: auto
unit:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: '**/*.sum'
- parallel:
- *install-controller-gen
- *install-diegen
- *install-goimports
- *install-kustomize
- *install-yq
- name: Test
run: make test
- name: Report coverage
uses: codecov/codecov-action@v7
env:
CODECOV_TOKEN: 0e521354-90f7-4a17-a876-73ca69b59cb5
- name: Disallow generated drift
run: |
set -o errexit
set -o nounset
set -o pipefail
git diff --exit-code .
stage:
name: Stage
runs-on: ubuntu-latest
env:
KO_PLATFORMS: linux/amd64,linux/arm64
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: '**/*.sum'
- parallel:
- *install-imgpkg
- *install-kbld
- *install-ko
- name: OCI registry
id: registry
uses: reconcilerio/registry@v1
- name: Build all platforms for tags
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "KO_PLATFORMS=all" >> $GITHUB_ENV
- name: Build
run: |
set -o errexit
set -o nounset
set -o pipefail
scratch=$(mktemp -d -t bundle.XXXX)
mkdir -p "${scratch}/.imgpkg"
mkdir -p "${scratch}/config"
cp LICENSE "${scratch}/LICENSE"
echo "##[group]Build"
cat hack/boilerplate.yaml.txt > "${scratch}/config/servicebinding-runtime.yaml"
${KO} resolve --platform ${KO_PLATFORMS} -f config/servicebinding-runtime.yaml >> "${scratch}/config/servicebinding-runtime.yaml"
cat hack/boilerplate.yaml.txt > "${scratch}/config/servicebinding-workloadresourcemappings.yaml"
cat config/servicebinding-workloadresourcemappings.yaml >> "${scratch}/config/servicebinding-workloadresourcemappings.yaml"
${KBLD} --imgpkg-lock-output "${scratch}/.imgpkg/images.yml" \
-f "${scratch}/config/servicebinding-runtime.yaml" \
-f "${scratch}/config/servicebinding-workloadresourcemappings.yaml" \
> /dev/null
echo "##[endgroup]"
echo "##[group]Create bundle"
bundle="${{ steps.registry.outputs.registry }}/servicebinding/bundle"
${IMGPKG} push -f "${scratch}" -b "${bundle}"
${IMGPKG} copy -b "${bundle}" --to-tar servicebinding-runtime-bundle.tar
echo "##[endgroup]"
env:
KO_DOCKER_REPO: ${{ steps.registry.outputs.registry }}/servicebinding
- uses: actions/upload-artifact@v7
with:
name: servicebinding-runtime-bundle.tar
path: servicebinding-runtime-bundle.tar
retention-days: 7
acceptance:
name: Acceptance Test
needs: stage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- kubernetes-version: v1.23
- kubernetes-version: v1.24
- kubernetes-version: v1.25
- kubernetes-version: v1.26
- kubernetes-version: v1.27
- kubernetes-version: v1.28
- kubernetes-version: v1.29
- kubernetes-version: v1.30
- kubernetes-version: v1.31
- kubernetes-version: v1.32
- kubernetes-version: v1.33
- kubernetes-version: v1.34
- kubernetes-version: v1.35
- kubernetes-version: v1.36
- kubernetes-version: v1.37
steps:
- uses: actions/checkout@v7
- parallel:
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: '**/*.sum'
- uses: actions/setup-python@v6
with:
python-version: "3.10"
- parallel:
- *install-imgpkg
- *install-kapp
- *install-kbld
- name: Start registry
id: registry
uses: reconcilerio/registry@v1
- name: kind cluster
uses: reconcilerio/kind@v1
with:
kubernetes-version: "${{ matrix.kubernetes-version }}"
registry: "${{ steps.registry.outputs.registry }}"
registry-ca: "${{ steps.registry.outputs.tls-ca }}"
- name: Download staged bundle
uses: actions/download-artifact@v8
with:
name: servicebinding-runtime-bundle.tar
- name: Relocate bundle
run: |
set -o errexit
set -o nounset
set -o pipefail
bundle="${{ steps.registry.outputs.registry }}/bundle"
${IMGPKG} copy --tar servicebinding-runtime-bundle.tar --to-repo "${bundle}"
mkdir -p bundle
${IMGPKG} pull -b "${bundle}" -o bundle
- name: Deploy
run: |
set -o errexit
set -o nounset
set -o pipefail
echo "##[group]Create namespace"
kubectl create ns apps
echo "##[endgroup]"
echo "##[group]Deploy cert-manager"
${KAPP} deploy -a cert-manager -n apps --wait-timeout 5m -y \
-f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
echo "##[endgroup]"
echo "##[group]Deploy servicebinding-runtime"
${KAPP} deploy -a servicebinding-runtime -n apps --wait-timeout 5m -y \
-f <(${KBLD} -f bundle/.imgpkg/images.yml -f bundle/config)
echo "##[endgroup]"
- name: Test samples
run: |
set -o errexit
set -o nounset
set -o pipefail
echo "##[group]Deploy spring-petclinic"
${KAPP} deploy -a servicebinding-sample-spring-petclinic -n apps --wait-timeout 5m -y \
-f samples/spring-petclinic
echo "##[endgroup]"
- name: Checkout conformance tests
uses: actions/checkout@v7
with:
repository: servicebinding/conformance.git
ref: v0.3.2
fetch-depth: 1
path: conformance-tests
- name: Conformance tests
working-directory: conformance-tests
run: |
set -o errexit
set -o nounset
set -o pipefail
echo "##[group]Setup conformance tests"
./setup.sh
echo "##[endgroup]"
echo "##[group]Run conformance tests"
./run_tests.sh -j 4
echo "##[endgroup]"
- name: Collect diagnostics
run: |
set +o errexit
set -o nounset
set +o pipefail
if [ -e conformance-tests/test-output/results/failing_scenarios.txt ] ; then
echo "##[group]failing conformance tests"
cat conformance-tests/test-output/results/failing_scenarios.txt
echo "##[endgroup]"
fi
echo "##[group]kubectl get clusterworkloadresourcemappings.servicebinding.io"
kubectl get clusterworkloadresourcemappings.servicebinding.io
echo "##[endgroup]"
echo "##[group]kubectl get servicebindings.servicebinding.io -A"
kubectl get servicebindings.servicebinding.io -A
echo "##[endgroup]"
echo "##[group]kubectl describe servicebindings.servicebinding.io -A"
kubectl describe servicebindings.servicebinding.io -A
echo "##[endgroup]"
echo "##[group]kapp list -A"
${KAPP} list -A
echo "##[endgroup]"
echo "##[group]kubectl get all -n servicebinding-system"
kubectl get all -n servicebinding-system
echo "##[endgroup]"
echo "##[group]kubectl get all -n servicebinding-cts"
kubectl get all -n servicebindings-cts
echo "##[endgroup]"
echo "##[group]kubectl describe deployments.apps -n servicebinding-system"
kubectl describe deployments.apps -n servicebinding-system
echo "##[endgroup]"
echo "##[group]kubectl describe deployments.apps -n servicebinding-cts"
kubectl describe deployments.apps -n servicebindings-cts
echo "##[endgroup]"
echo "##[group]kubectl describe mutatingwebhookconfigurations.admissionregistration.k8s.io servicebinding-admission-projector"
kubectl describe mutatingwebhookconfigurations.admissionregistration.k8s.io servicebinding-admission-projector
echo "##[endgroup]"
echo "##[group]kubectl describe validatingwebhookconfigurations.admissionregistration.k8s.io servicebinding-trigger"
kubectl describe validatingwebhookconfigurations.admissionregistration.k8s.io servicebinding-trigger
echo "##[endgroup]"
echo "##[group]kubectl logs -n servicebinding-system -l control-plane=controller-manager --tail 10000"
kubectl logs -n servicebinding-system -l control-plane=controller-manager --tail 10000
echo "##[endgroup]"
if: always()
continue-on-error: true
- name: Save test results
uses: actions/upload-artifact@v7
if: always()
with:
name: acceptance-test-results-${{ matrix.kubernetes-version }}
path: conformance-tests/test-output/results
- name: Delete Gracefully
run: |
set -o errexit
set -o nounset
set -o pipefail
echo "##[group]Delete spring-petclinic"
${KAPP} delete -a servicebinding-sample-spring-petclinic -n apps --wait-timeout 5m -y
echo "##[endgroup]"
echo "##[group]Delete servicebinding-runtime"
${KAPP} delete -a servicebinding-runtime -n apps --wait-timeout 5m -y
echo "##[endgroup]"
echo "##[group]Delete cert-manager"
${KAPP} delete -a cert-manager -n apps --wait-timeout 5m -y
echo "##[endgroup]"
if: always()
# aggregate the unit and acceptance results into a single job
test:
name: Test
needs:
- unit
- acceptance
runs-on: ubuntu-latest
steps:
- run: echo "it passed"
release:
name: Release
needs:
- test
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: '**/*.sum'
- parallel:
- *install-crane
- *install-imgpkg
- *install-kbld
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Draft release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.get_version.outputs.VERSION }}
draft: true
- name: Download staged bundle
uses: actions/download-artifact@v8
with:
name: servicebinding-runtime-bundle.tar
- name: Upload servicebinding-runtime-bundle.tar
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: servicebinding-runtime-bundle.tar
asset_name: servicebinding-runtime-bundle-${{ steps.get_version.outputs.VERSION }}.tar
asset_content_type: application/x-tar
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Relocate bundle to public registry
run: |
set -o errexit
set -o nounset
set -o pipefail
version=${{ steps.get_version.outputs.VERSION }}
${IMGPKG} copy --tar servicebinding-runtime-bundle.tar --to-repo "ghcr.io/${{ github.repository }}/bundle"
crane tag "ghcr.io/${{ github.repository }}/bundle" "${version}"
digest=$(crane digest "ghcr.io/${{ github.repository }}/bundle:${version}")
scratch=$(mktemp -d -t bundle.XXXX)
mkdir -p ${scratch}
${IMGPKG} pull -b "ghcr.io/${{ github.repository }}/bundle:${version}@${digest}" -o ${scratch}
cp hack/boilerplate.yaml.txt servicebinding-runtime.yaml
${KBLD} -f ${scratch}/config/servicebinding-runtime.yaml -f ${scratch}/.imgpkg/images.yml \
>> servicebinding-runtime.yaml
cp hack/boilerplate.yaml.txt servicebinding-workloadresourcemappings.yaml
${KBLD} -f ${scratch}/config/servicebinding-workloadresourcemappings.yaml -f ${scratch}/.imgpkg/images.yml \
>> servicebinding-workloadresourcemappings.yaml
- name: Upload servicebinding-runtime.yaml
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: servicebinding-runtime.yaml
asset_name: servicebinding-runtime-${{ steps.get_version.outputs.VERSION }}.yaml
asset_content_type: application/x-yaml
- name: Upload servicebinding-workloadresourcemappings.yaml
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: servicebinding-workloadresourcemappings.yaml
asset_name: servicebinding-workloadresourcemappings-${{ steps.get_version.outputs.VERSION }}.yaml
asset_content_type: application/x-yaml