mirror of
https://github.com/stackrox/kube-linter-action.git
synced 2026-07-04 23:51:37 +00:00
Allow to override output format and action fixes (#7)
Co-authored-by: Armel Soro <armel@rm3l.org>
This commit is contained in:
@@ -10,56 +10,66 @@ on:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test-scan-linux:
|
||||
test-scan:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
format: [ plain, json, sarif ]
|
||||
version: [ latest, 0.2.3 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Scan 1 - should succeed
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/valid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
format: ${{ matrix.format }}
|
||||
version: ${{ matrix.version }}
|
||||
|
||||
- name: Scan 2 - should fail
|
||||
id: failing-scan
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/invalid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
format: ${{ matrix.format }}
|
||||
version: ${{ matrix.version }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Verify Scan 2 should have failed
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Verifying that kube-linter-action outcome (${{ steps.failing-scan.outcome }}) from Scan 2 is failure."
|
||||
[[ "${{ steps.failing-scan.outcome }}" == "failure" ]]
|
||||
|
||||
test-with-sarif-upload:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Scan 1 - succeeding
|
||||
# Setup directory where github/codeql-action/upload-sarif@v1 looks up files by default.
|
||||
- name: Create ../results directory for sarif files
|
||||
shell: bash
|
||||
run: mkdir -p ../results
|
||||
|
||||
- name: Scan 1 - should succeed
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/valid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
format: sarif
|
||||
output-file: ../results/kube-linter-success.sarif
|
||||
|
||||
- name: Scan 2 - failing
|
||||
- name: Scan 2 - should fail
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/invalid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
format: sarif
|
||||
output-file: ../results/kube-linter-fail.sarif
|
||||
continue-on-error: true
|
||||
|
||||
test-scan-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Scan 1 - succeeding
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/valid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
|
||||
- name: Scan 2 - failing
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/invalid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
continue-on-error: true
|
||||
|
||||
test-scan-macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Scan 1 - succeeding
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/valid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
|
||||
- name: Scan 2 - failing
|
||||
uses: ./
|
||||
with:
|
||||
directory: sample/invalid-yaml
|
||||
config: sample/.kube-linter-config.yaml
|
||||
continue-on-error: true
|
||||
- name: Upload SARIF output file to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
|
||||
Reference in New Issue
Block a user