forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIFI-14137 Added code-compliance workflow with Syft and Grype
- Moved Static Analysis job from ci-workflow to code-compliance workflow
- Loading branch information
1 parent
547f101
commit daea390
Showing
3 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
name: code-compliance | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
pull_request: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
security-events: write | ||
contents: write | ||
pull-requests: read | ||
|
||
env: | ||
DEFAULT_MAVEN_OPTS: >- | ||
-Xms6g | ||
-Xmx6g | ||
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN | ||
jobs: | ||
validate: | ||
timeout-minutes: 60 | ||
name: Validate | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Maven Validate | ||
run: > | ||
./mvnw | ||
--show-version | ||
--no-snapshot-updates | ||
--no-transfer-progress | ||
--fail-fast | ||
--activate-profiles contrib-check | ||
validate | ||
scan: | ||
timeout-minutes: 120 | ||
name: Scan | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: java | ||
- name: Maven Package | ||
env: | ||
MAVEN_OPTS: >- | ||
${{ env.DEFAULT_MAVEN_OPTS }} | ||
run: > | ||
./mvnw | ||
--show-version | ||
--no-snapshot-updates | ||
--no-transfer-progress | ||
--fail-fast | ||
-DskipTests | ||
pmd:check | ||
package | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
- name: Get Project Version | ||
run: echo "PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Generate SBOM | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
format: spdx-json | ||
path: '' | ||
file: nifi-assembly/target/nifi-${{ env.PROJECT_VERSION }}-bin.zip | ||
artifact-name: nifi-${{ env.PROJECT_VERSION }}.spdx.json | ||
output-file: nifi-${{ env.PROJECT_VERSION }}.spdx.json | ||
- name: Scan SBOM | ||
uses: anchore/scan-action@v6 | ||
with: | ||
sbom: nifi-${{ env.PROJECT_VERSION }}.spdx.json | ||
fail-build: false |
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