Skip to content

Commit c7772d7

Browse files
committed
added matrix example to tests
1 parent 5f0af1a commit c7772d7

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

scanner/inventory_scanner_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func TestGithubWorkflows(t *testing.T) {
2323
assert.ElementsMatch(t, paths, []string{
2424
".github/workflows/debug_enabled_valid.yml",
2525
".github/workflows/valid.yml",
26+
".github/workflows/matrix.yml",
2627
".github/workflows/reusable.yml",
2728
".github/workflows/secrets.yaml",
2829
".github/workflows/workflow_run_valid.yml",

scanner/inventory_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func TestPurls(t *testing.T) {
3434
"pkg:githubactions/kartverket/[email protected]#.github/workflows/run-terraform.yml",
3535
"pkg:docker/alpine%3Alatest",
3636
"pkg:githubactions/actions/github-script@main",
37+
"pkg:githubactions/actions/setup-node@v4",
3738
"pkg:githubactions/hashicorp/[email protected]",
3839
"pkg:githubactions/actions/checkout@v4",
3940
"pkg:docker/ruby%3A3.2",
@@ -51,7 +52,7 @@ func TestPurls(t *testing.T) {
5152
"pkg:githubactions/org/owner@main#.github/workflows/ci.yml",
5253
}
5354
assert.ElementsMatch(t, i.Purls(*scannedPackage), purls)
54-
assert.Equal(t, 19, len(scannedPackage.BuildDependencies))
55+
assert.Equal(t, 20, len(scannedPackage.BuildDependencies))
5556
assert.Equal(t, 4, len(scannedPackage.PackageDependencies))
5657
}
5758

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: matrix.yml
2+
on:
3+
push:
4+
5+
jobs:
6+
example_matrix:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-22.04, ubuntu-20.04]
10+
version: [10, 12, 14]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: ${{ matrix.version }}

0 commit comments

Comments
 (0)