|
| 1 | +# |
| 2 | +# MIT License |
| 3 | +# |
| 4 | +# (C) Copyright 2025 Hewlett Packard Enterprise Development LP |
| 5 | +# |
| 6 | +# Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | +# copy of this software and associated documentation files (the "Software"), |
| 8 | +# to deal in the Software without restriction, including without limitation |
| 9 | +# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | +# and/or sell copies of the Software, and to permit persons to whom the |
| 11 | +# Software is furnished to do so, subject to the following conditions: |
| 12 | +# |
| 13 | +# The above copyright notice and this permission notice shall be included |
| 14 | +# in all copies or substantial portions of the Software. |
| 15 | +# |
| 16 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 20 | +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 21 | +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 22 | +# OTHER DEALINGS IN THE SOFTWARE. |
| 23 | +# |
| 24 | +name: Test build-sign-scan reusable workflow |
| 25 | + |
| 26 | +on: |
| 27 | + push: |
| 28 | + paths: |
| 29 | + - .github/workflows/test-build-sign-scan.yaml |
| 30 | + - build-sign-scan/** |
| 31 | + workflow_dispatch: |
| 32 | + |
| 33 | +jobs: |
| 34 | + test-docker-build-local: |
| 35 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 36 | + with: |
| 37 | + context_path: build-sign-scan/tests/alpine |
| 38 | + docker_tag: artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-local |
| 39 | + docker_push: false |
| 40 | + snyk: false |
| 41 | + sign: false |
| 42 | + |
| 43 | + test-docker-build-single-platform: |
| 44 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 45 | + with: |
| 46 | + context_path: build-sign-scan/tests/alpine |
| 47 | + docker_tag: artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-single-platform |
| 48 | + docker_additional_tags: | |
| 49 | + artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-single-platform-1 |
| 50 | + snyk: false |
| 51 | + sign: false |
| 52 | + secrets: inherit |
| 53 | + |
| 54 | + test-docker-build-multi-platform: |
| 55 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 56 | + with: |
| 57 | + context_path: build-sign-scan/tests/alpine |
| 58 | + docker_tag: artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-multi-platform |
| 59 | + docker_build_platforms: linux/amd64,linux/arm64 |
| 60 | + docker_additional_tags: | |
| 61 | + artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-multi-platform-1 |
| 62 | + snyk: false |
| 63 | + sign: false |
| 64 | + secrets: inherit |
| 65 | + |
| 66 | + test-docker-build-secrets: |
| 67 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 68 | + with: |
| 69 | + context_path: build-sign-scan/tests/sles |
| 70 | + docker_tag: artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-secrets |
| 71 | + docker_build_platforms: linux/amd64,linux/arm64 |
| 72 | + docker_additional_tags: | |
| 73 | + artifactory.algol60.net/csm-docker-backup/unstable/test-build-sign-scan:test-secrets-1 |
| 74 | + snyk: false |
| 75 | + sign: false |
| 76 | + secrets: |
| 77 | + docker_username: ${{ secrets.ARTIFACTORY_ALGOL60_USERNAME }} |
| 78 | + docker_password: ${{ secrets.ARTIFACTORY_ALGOL60_TOKEN }} |
| 79 | + docker_secrets: | |
| 80 | + SLES_REPO_USERNAME=${{ secrets.ARTIFACTORY_ALGOL60_READONLY_USERNAME }} |
| 81 | + SLES_REPO_PASSWORD=${{ secrets.ARTIFACTORY_ALGOL60_READONLY_TOKEN }} |
| 82 | + gcp_workload_identity_provider: ${{ secrets.COSIGN_GCP_WORKLOAD_IDENTITY_PROVIDER_RSA }} |
| 83 | + gcp_service_account: ${{ secrets.COSIGN_GCP_SERVICE_ACCOUNT_RSA }} |
| 84 | + gcp_cosign_key: ${{ secrets.COSIGN_KEY_RSA }} |
| 85 | + snyk_token: ${{ secrets.SNYK_TOKEN }} |
| 86 | + |
| 87 | + test-docker-build-google: |
| 88 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 89 | + with: |
| 90 | + context_path: build-sign-scan/tests/alpine |
| 91 | + docker_login: false |
| 92 | + docker_oidc: true |
| 93 | + docker_tag: us-docker.pkg.dev/hpe-stage-csm-release/csm-docker/unstable/test-build-sign-scan:test-google |
| 94 | + docker_build_platforms: linux/amd64,linux/arm64 |
| 95 | + docker_additional_tags: | |
| 96 | + us-docker.pkg.dev/hpe-stage-csm-release/csm-docker/unstable/test-build-sign-scan:test-google-1 |
| 97 | + snyk: false |
| 98 | + sign: false |
| 99 | + secrets: inherit |
| 100 | + |
| 101 | + test-makefile-local: |
| 102 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 103 | + with: |
| 104 | + context_path: build-sign-scan/tests/alpine |
| 105 | + make_target: local |
| 106 | + docker_login: false |
| 107 | + snyk: false |
| 108 | + sign: false |
| 109 | + |
| 110 | + test-makefile-single-platform: |
| 111 | + uses: ./.github/workflows/build-sign-scan.yaml |
| 112 | + with: |
| 113 | + context_path: build-sign-scan/tests/alpine |
| 114 | + make_target: unstable |
| 115 | + env: | |
| 116 | + VERSION=test-makefile-single-platform |
| 117 | + snyk: false |
| 118 | + sign: false |
| 119 | + secrets: inherit |
| 120 | + |
| 121 | + review: |
| 122 | + runs-on: ubuntu-latest |
| 123 | + |
| 124 | + permissions: |
| 125 | + contents: 'read' |
| 126 | + id-token: 'write' |
| 127 | + |
| 128 | + needs: |
| 129 | + - test-docker-build-local |
| 130 | + - test-docker-build-single-platform |
| 131 | + - test-docker-build-multi-platform |
| 132 | + - test-docker-build-google |
| 133 | + |
| 134 | + steps: |
| 135 | + - name: Dump needs context |
| 136 | + env: |
| 137 | + NEEDS_CONTEXT: ${{ toJSON(needs) }} |
| 138 | + run: | |
| 139 | + echo "$NEEDS_CONTEXT" > outputs.json |
0 commit comments