Skip to content

Commit

Permalink
chore: consolidate test workflows in test.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Zantow <kzantow@gmail.com>
  • Loading branch information
kzantow committed May 20, 2024
1 parent 9aed9bf commit e0a00e3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 92 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/demo.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/sarifdemo.yml

This file was deleted.

96 changes: 95 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- run: npm run audit
- run: npm test

test-as-action: # run actions to test some scenarios
test-download-action:
runs-on: ubuntu-latest

steps:
Expand All @@ -69,3 +69,97 @@ jobs:

- name: "Check Grype version after scan-action"
run: grype version | egrep "^Version:.*0.54.0$"

test-image-input:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: ./
with:
image: "alpine:latest"
fail-build: false

test-directory-input:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: ./
with:
path: "tests/fixtures/npm-project"
fail-build: false

test-sbom-input:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: ./
with:
sbom: tests/fixtures/test_sbom.spdx.json
fail-build: false

test-table-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: ./
with:
output-format: table
image: "alpine:latest"
fail-build: false

test-windows-image:
runs-on: windows-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: ./
with:
image: "alpine:latest"
fail-build: false

test-windows-path:
runs-on: windows-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: ./
with:
path: "tests/fixtures/npm-project"
fail-build: false

test-sarif-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: scan
uses: ./
with:
image: "debian:8"
fail-build: false

- name: Validate file exists
run: ls ${{ steps.scan.outputs.sarif }}

test-sarif-directory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: scan
uses: ./
with:
path: "tests/fixtures/npm-project"
fail-build: false

- name: Validate file exists
run: ls ${{ steps.scan.outputs.sarif }}

test-json-directory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: scan
uses: ./
with:
path: "tests/fixtures/npm-project"
fail-build: false

- name: Validate file exists
run: ls ${{ steps.scan.outputs.json }}

0 comments on commit e0a00e3

Please sign in to comment.