build(deps): bump helm/kind-action from 1.3.0 to 1.14.0 #2910
This file contains hidden or 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
| name: Test and Promote KMIs | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| flavor: | |
| description: "Image Flavor to test (ex. ubuntu-24-04)" | |
| required: true | |
| env: | |
| FLAVOR: ${{ github.event.inputs.flavor || 'ubuntu-24-04' }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install bats | |
| run: sudo npm install -g bats | |
| - name: Create kind cluster | |
| uses: helm/kind-action@v1.14.0 | |
| with: | |
| config: .github/workflows/kind/config.yml | |
| - name: Deploy and test ${{ env.FLAVOR }} | |
| run: | | |
| bats tests/run.bats --show-output-of-passing-tests --timing --verbose-run | |
| - name: Archive test logs | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: ${{ env.FLAVOR }}-logs | |
| path: | | |
| ${{ github.workspace }}/logs/* | |
| promote: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| needs: test | |
| permissions: | |
| id-token: write | |
| env: | |
| COSIGN_EXPERIMENTAL: 1 | |
| steps: | |
| - name: Setup cosign | |
| uses: sigstore/cosign-installer@main | |
| - name: Login Docker Hub | |
| uses: redhat-actions/podman-login@v1 | |
| with: | |
| logout: false | |
| registry: docker.io | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_PASSWD }} | |
| - name: Login Docker Hub | |
| uses: docker/login-action@v2.0.0 | |
| with: | |
| logout: false | |
| registry: docker.io | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_PASSWD }} | |
| # - name: Login Quay.io | |
| # uses: docker/login-action@v2.0.0 | |
| # with: | |
| # logout: false | |
| # registry: quay.io | |
| # username: ${{ secrets.QUAY_USER }} | |
| # password: ${{ secrets.QUAY_PASSWD }} | |
| - name: Copy the manifest to product tag | |
| run: | | |
| skopeo copy --all \ | |
| docker://docker.io/containercraft/${FLAVOR/-/:}-dev \ | |
| docker://docker.io/containercraft/${FLAVOR/-/:} | |
| - name: Sign the image | |
| run: cosign sign --recursive docker.io/containercraft/${FLAVOR/-/:} | |
| - name: Wait for signature propagation | |
| run: sleep 5 | |
| - name: Verify the image | |
| run: | | |
| # Retry verification up to 3 times with 10 second delays to handle registry propagation | |
| for i in {1..3}; do | |
| if cosign verify docker.io/containercraft/${FLAVOR/-/:} \ | |
| --certificate-identity-regexp='https://github.com/ContainerCraft/kmi/.*' \ | |
| --certificate-oidc-issuer=https://token.actions.githubusercontent.com; then | |
| echo "Verification succeeded on attempt $i" | |
| exit 0 | |
| else | |
| echo "Verification attempt $i failed, waiting 10 seconds..." | |
| sleep 10 | |
| fi | |
| done | |
| echo "Verification failed after 3 attempts" | |
| exit 1 |