Skip to content

Merge pull request #69 from docker/dependabot/github_actions/actions/… #105

Merge pull request #69 from docker/dependabot/github_actions/actions/…

Merge pull request #69 from docker/dependabot/github_actions/actions/… #105

Workflow file for this run

name: e2e
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
env:
BUILDX_VERSION: v0.10.0
BUILDKIT_IMAGE: moby/buildkit:v0.11.2
IMAGE_LOCAL: localhost:5000/buildkit-syft-scanner:latest
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.examples.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create matrix
id: examples
run: |
examples=$(jq -ncR '[inputs]' <<< "$(ls -A ./examples/)")
echo "matrix=$examples" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.examples.outputs.matrix }}
test:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
example: ${{ fromJson(needs.prepare.outputs.matrix) }}
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: |
network=host
image=${{ env.BUILDKIT_IMAGE }}
-
name: Build and push Syft Scanner image
uses: docker/bake-action@v3
with:
targets: image-local
push: true
-
name: Test
run: |
./hack/check-example.sh ${{ env.IMAGE_LOCAL }} ${{ matrix.example }}
-
name: Check output folder
run: |
tree ./examples/${{ matrix.example }}/build
-
name: Print SBOM
if: matrix.example != 'scratch'
run: |
jq . ./examples/${{ matrix.example }}/build/sbom-base.spdx.json
-
name: Upload output folder
uses: actions/upload-artifact@v3
with:
name: e2e-${{ matrix.example }}
path: ./examples/${{ matrix.example }}/build/*
if-no-files-found: error