Fix various SBOM creation problems #7
Workflow file for this run
This file contains 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
# ******************************************************************************** | |
# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation | |
# | |
# See the NOTICE file(s) with this work for additional | |
# information regarding copyright ownership. | |
# | |
# This program and the accompanying materials are made | |
# available under the terms of the Apache Software License 2.0 | |
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# ******************************************************************************** | |
--- | |
name: TestCycloneDX | |
on: | |
pull_request: | |
branches: [master] | |
paths: | |
- ".github/workflows/testsbom.yml" | |
- "cyclonedx-lib/**" | |
# Cancel existing runs if user makes another push. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
permissions: | |
contents: read | |
jobs: | |
test_cyclonedx_gen: | |
name: gen_cyclonedx | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
# Build with jdk8 to ensure TemurinGen* meets min compatibility | |
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | |
id: setup-java | |
with: | |
java-version: 8 | |
distribution: 'temurin' | |
- name: Build TemurinGenSBOM.java and TemurinGenCDXA.java | |
run: | | |
ant -noinput -buildfile cyclonedx-lib/build.xml clean | |
ant -noinput -buildfile cyclonedx-lib/build.xml build | |
- name: Run TemurinGenSBOM Unit test | |
run: ant -noinput -buildfile cyclonedx-lib/build.xml run | |
- name: Run TemurinGenCDXA Unit test | |
run: ant -noinput -buildfile cyclonedx-lib/build.xml runCDXA | |
- name: Validate generated SBOM and CDXA documents using cyclonedx-cli validate | |
run: | | |
curl -L -O https://github.com/CycloneDX/cyclonedx-cli/releases/latest/download/cyclonedx-linux-x64 | |
chmod +x cyclonedx-linux-x64 | |
./cyclonedx-linux-x64 validate --input-file cyclonedx-lib/build/testSBOM.json --fail-on-errors --input-version v1_6 | |
./cyclonedx-linux-x64 validate --input-file cyclonedx-lib/build/testSBOM.xml --fail-on-errors --input-version v1_6 | |
./cyclonedx-linux-x64 validate --input-file cyclonedx-lib/build/testCDXA.json --fail-on-errors --input-version v1_6 | |
./cyclonedx-linux-x64 validate --input-file cyclonedx-lib/build/testCDXA.xml --fail-on-errors --input-version v1_6 | |
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
name: Collect and Archive TemurinGenSBOM Artifacts | |
with: | |
name: testSBOM | |
path: cyclonedx-lib/build/testSBOM.* | |
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
name: Collect and Archive TemurinGenCDXA Artifacts | |
with: | |
name: testCDXA | |
path: cyclonedx-lib/build/testCDXA.* | |