Skip to content

Move SCAI CI steps to separrate job #14

Move SCAI CI steps to separrate job

Move SCAI CI steps to separrate job #14

Workflow file for this run

#
# SPDX-License-Identifier: Apache-2.0
#
name: PDO CI with SW supply chain metadata
on: [pull_request, push]
jobs:
pdo_ci:
outputs:
img_hash_wawaka: ${{ steps.hash.outputs.img_hash_wawaka }}
if: "!contains(github.event.commits[0].message, '[skip ci]')"
name: PDO CI Job
runs-on: ubuntu-20.04
strategy:
matrix:
interpreter: [wawaka]
pdo_ledger_type: [ccf]
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Build all containers
env:
PDO_INTERPRETER: ${{ matrix.interpreter }}
run: |
# The creation of a dummy branch is necessary for the CI tests
# to work on PRs. Based on empirical results, in the absence of
# this command, CI tests work on the main branch and on local
# branches. However, they fail as a PR is created.
git checkout -b ci-test-branch
. build/common-config.sh
strace -f -e trace=network -o build/strace.log make -C docker all
- name: Generate SBOM
uses: anchore/sbom-action@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
with:
image: pdo_client
artifact-name: "pdo_client_${{ matrix.interpreter }}.spdx.json"
upload-release-assets: false
- name: Get image hash
shell: bash
id: hash
run: |
# this extracts the sha256 hash
echo "img_hash_${{ matrix.interpreter }}=$(docker inspect pdo_client --format {{.ID}} | sed 's/.*://' | sed 's/$/ pdo_client_${{ matrix.interpreter }}/' | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Upload strace log
uses: actions/upload-artifact@v3
with:
name: strace-log
path: build/strace.log
provenance:
needs: [pdo_ci]
strategy:
matrix:
interpreter: [wawaka]
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
contents: write # for uploading attestations.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.pdo_ci.outputs[format('img_hash_{0}', matrix.interpreter)] }}"
provenance-name: "pdo_client_${{ matrix.interpreter }}.slsa.intoto.jsonl"
scai:
needs: [pdo_ci, provenance]
steps:
- name: Generate SBOM SCAI AttributeAssertion
uses: marcelamelara/scai-demos/.github/actions/scai-gen-assert@add-scai-reusable-workflows
with:

Check failure on line 77 in .github/workflows/ci-swsc.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-swsc.yaml

Invalid workflow file

You have an error in your yaml syntax on line 77
attribute: "HasSBOM"
evidence-file: "pdo_client_wawaka.spdx.json"