Skip to content

Bump chainguard-dev/actions from 1.5.2 to 1.5.7 #2919

Bump chainguard-dev/actions from 1.5.2 to 1.5.7

Bump chainguard-dev/actions from 1.5.2 to 1.5.7 #2919

Workflow file for this run

name: Fulcio&Rekor E2E Tests Using Release
on:
pull_request:
branches: [ main ]
defaults:
run:
shell: bash
working-directory: ./
concurrency:
group: fulcio-rekor-kind-using-release-${{ github.head_ref }}
cancel-in-progress: true
jobs:
fulcio-rekor-ctlog-tests-using-release:
name: e2e tests using release
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.31.x
- v1.32.x
- v1.33.x
- v1.34.x
leg:
- fulcio rekor ctlog e2e
go-version:
- 1.25.x
env:
RELEASE_VERSION: "v0.7.22"
KO_DOCKER_REPO: registry.local:5000/knative
KOCACHE: ~/ko
steps:
- uses: chainguard-dev/actions/setup-mirror@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
- uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
- name: Setup Cluster
uses: chainguard-dev/actions/setup-kind@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
id: kind
with:
k8s-version: ${{ matrix.k8s-version }}
registry-authority: registry.local:5000
cluster-suffix: cluster.local
service-account-issuer: https://kubernetes.default.svc.cluster.local
- name: Setup Knative
uses: chainguard-dev/actions/setup-knative@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7
with:
version: "1.18.x"
serving-features: >
{
"kubernetes.podspec-fieldref": "enabled"
}
- name: Install scaffolding
timeout-minutes: 10
run: |
curl -Lo /tmp/setup-scaffolding-from-release.sh https://github.com/sigstore/scaffolding/releases/download/${RELEASE_VERSION}/setup-scaffolding-from-release.sh
chmod u+x /tmp/setup-scaffolding-from-release.sh
/tmp/setup-scaffolding-from-release.sh --release-version ${RELEASE_VERSION}
# TODO(vaikas): Figure out how these could be exposed by above.
REKOR_URL=$(kubectl -n rekor-system get ksvc rekor -ojsonpath='{.status.url}')
FULCIO_URL=$(kubectl -n fulcio-system get ksvc fulcio -ojsonpath='{.status.url}')
FULCIO_GRPC_URL=$(kubectl -n fulcio-system get ksvc fulcio-grpc -ojsonpath='{.status.url}')
CTLOG_URL=$(kubectl -n ctlog-system get ksvc ctlog -ojsonpath='{.status.url}')
TUF_MIRROR=$(kubectl -n tuf-system get ksvc tuf -ojsonpath='{.status.url}')
TSA_URL=$(kubectl -n tsa-system get ksvc tsa -ojsonpath='{.status.url}')
# Set the endopints
echo "REKOR_URL=$REKOR_URL" >> $GITHUB_ENV
echo "FULCIO_URL=$FULCIO_URL" >> $GITHUB_ENV
echo "FULCIO_GRPC_URL=$FULCIO_GRPC_URL" >> $GITHUB_ENV
echo "CTLOG_URL=$CTLOG_URL" >> $GITHUB_ENV
echo "TUF_MIRROR=$TUF_MIRROR" >> $GITHUB_ENV
echo "TSA_URL=$TSA_URL" >> $GITHUB_ENV
# Make copy of the tuf root in the default namespace for tests
kubectl -n tuf-system get secrets tuf-root -oyaml | sed 's/namespace: .*/namespace: default/' | kubectl create -f -
env:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
- name: Create sample image
run: |
pushd $(mktemp -d)
go mod init example.com/demo-with-release
cat <<EOF > main.go
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
EOF
demoimage=`ko publish -B example.com/demo-with-release`
echo "demoimage=$demoimage" >> $GITHUB_ENV
echo Created image $demoimage
popd
- name: Run test jobs on the cluster
run: |
curl -L https://github.com/sigstore/scaffolding/releases/download/${RELEASE_VERSION}/testrelease.yaml | kubectl apply -f -
kubectl wait --for=condition=Complete --timeout=240s job/sign-job
kubectl wait --for=condition=Complete --timeout=240s job/verify-job
env:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
- name: Get the issuer url endpoint on the cluster
run: |
ISSUER_URL=$(kubectl get ksvc gettoken -ojsonpath='{.status.url}')
echo "ISSUER_URL=$ISSUER_URL" >> $GITHUB_ENV
OIDC_TOKEN=$(curl -s $ISSUER_URL)
echo "OIDC_TOKEN=$OIDC_TOKEN" >> $GITHUB_ENV
- name: Initialize cosign with our TUF root
run: cosign initialize --mirror ${TUF_MIRROR} --root ./root.json
env:
TUF_MIRROR: ${{ env.TUF_MIRROR }}
- name: Sign with cosign from the action using k8s token
run: |
cosign sign --yes --rekor-url ${REKOR_URL} --fulcio-url ${FULCIO_URL} --allow-insecure-registry ${DEMOIMAGE} --identity-token ${OIDC_TOKEN}
env:
REKOR_URL: ${{ env.REKOR_URL }}
FULCIO_URL: ${{ env.FULCIO_URL }}
DEMOIMAGE: ${{ env.demoimage }}
OIDC_TOKEN: ${{ env.OIDC_TOKEN }}
- name: Verify with cosign from the action using k8s token
run: |
cosign verify --rekor-url "${REKOR_URL}" \
--allow-insecure-registry "${DEMOIMAGE}" \
--certificate-identity "https://kubernetes.io/namespaces/default/serviceaccounts/default" \
--certificate-oidc-issuer "https://kubernetes.default.svc.cluster.local"
env:
REKOR_URL: ${{ env.REKOR_URL }}
DEMOIMAGE: ${{ env.demoimage }}
- name: Checkout TSA for testing.
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: sigstore/timestamp-authority
path: ./src/github.com/sigstore/timestamp-authority
persist-credentials: false
- name: Build timestamp-cli
working-directory: ./src/github.com/sigstore/timestamp-authority
run: |
go build -o ./timestamp-cli ./cmd/timestamp-cli
- name: Exercise TSA
working-directory: ./src/github.com/sigstore/timestamp-authority
run: |
curl ${TSA_URL}/api/v1/timestamp/certchain > ts_chain.pem
echo "myblob" > myblob
if ! ./timestamp-cli --timestamp_server ${TSA_URL} timestamp --hash sha256 --artifact myblob --out response.tsr ; then
echo "failed to timestamp artifact"
exit -1
fi
if ! ./timestamp-cli verify --timestamp response.tsr --artifact "myblob" --certificate-chain ts_chain.pem ; then
echo "failed to verify timestamp"
exit -1
fi
if ! ./timestamp-cli inspect --timestamp response.tsr --format json ; then
echo "failed to inspect the timestamp"
exit -1
fi
env:
TSA_URL: ${{ env.TSA_URL }}
- name: Collect diagnostics
if: ${{ failure() }}
uses: chainguard-dev/actions/kind-diag@1b32103f5aa389c31ab0be75a8edc38d7e4750d8 # v1.5.7