Bump the ci group with 2 updates #145
Workflow file for this run
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: run-tests-on-pr | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| jobs: | |
| test-multi-arch-build: | |
| uses: docker/github-builder/.github/workflows/build.yml@7d2a02426d4b989616ba5aaee4e879afd4134b0d # v1.6.0 | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| with: | |
| output: image | |
| push: false | |
| platforms: linux/amd64,linux/arm64 | |
| sbom: true | |
| cache: true | |
| context: . | |
| set-meta-labels: true | |
| set-meta-annotations: true | |
| meta-images: | | |
| hello-world | |
| meta-tags: | | |
| type=ref,event=pr | |
| secrets: | |
| registry-auths: | | |
| - username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| scan-container: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1 | |
| with: | |
| egress-policy: audit | |
| - name: checkout code in current PR branch | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker | |
| uses: docker/setup-docker-action@b2189fbf2a6592b51fee7cdd93ee2bfaeba733db # v5.1.0 | |
| with: | |
| daemon-config: | | |
| { | |
| "debug": true, | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| with: | |
| version: latest | |
| - name: docker login docker.io | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: docker login dhi.io | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| registry: dhi.io | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Build container image from PR branch | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| provenance: mode=max | |
| sbom: true | |
| tags: hello-world:pr-${{ github.event.number }} | |
| - name: docker images | |
| run: | | |
| docker images | |
| - name: checkout code in main branch | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: main | |
| - name: Build container image from main branch | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| provenance: mode=max | |
| sbom: true | |
| tags: hello-world:main | |
| - name: docker images | |
| run: | | |
| docker images | |
| - name: Docker Scout Comparison between main branch and current PR branch | |
| uses: docker/scout-action@bacf462e8d090c09660de30a6ccc718035f961e3 # v1.20.4 | |
| with: | |
| command: compare | |
| image: local://hello-world:pr-${{ github.event.number }} | |
| to: local://hello-world:main | |
| write-comment: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| organization: ${{ secrets.DOCKER_HUB_ORG }} | |
| test-container: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1 | |
| with: | |
| egress-policy: audit | |
| - name: checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| with: | |
| version: latest | |
| - name: docker login | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: install score-compose | |
| uses: score-spec/setup-score@1db79668fdd7b3e68ca5d5a734aad29ea75901cd # v3.2.3 | |
| with: | |
| file: score-compose | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| version: latest | |
| - name: make compose-test | |
| run: | | |
| make compose-test | |
| - name: make kind-create-cluster | |
| run: | | |
| make kind-create-cluster | |
| - name: make kind-load-image | |
| run: | | |
| make kind-load-image | |
| - name: install score-k8s | |
| uses: score-spec/setup-score@1db79668fdd7b3e68ca5d5a734aad29ea75901cd # v3.2.3 | |
| with: | |
| file: score-k8s | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| version: latest | |
| - name: make k8s-up | |
| id: k8s-up | |
| run: | | |
| make k8s-up | |
| - name: catch k8s-up errors | |
| if: ${{ failure() && steps.k8s-up.outcome == 'failure' }} | |
| run: | | |
| kubectl get events | |
| kubectl logs \ | |
| -l score-workload=hello-world |