Skip to content

Commit f024c43

Browse files
committed
Split action to reuse the version of the action to use between all jobs
1 parent 4c402a7 commit f024c43

File tree

2 files changed

+47
-43
lines changed

2 files changed

+47
-43
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Smoke Test Runner (Reusable)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
provider:
7+
required: true
8+
type: string
9+
provider-config:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
run-test:
15+
name: Run Test (${{ inputs.provider }})
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout scanner registry
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Run Tests
23+
uses: martin-boost-dev/boostsec-registry-test-action@ae4ca8bcb5d76bd0c14cef22aece7493da7ba423
24+
with:
25+
provider: ${{ inputs.provider }}
26+
provider-config: ${{ inputs.provider-config }}
27+
registry-path: "."
28+
base-ref: "main"
29+
head-ref: "${{ github.head_ref }}"

.github/workflows/smoke-tests.yaml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Smoke Tests
22

3-
env:
4-
ACTION: martin-boost-dev/boostsec-registry-test-action@ae4ca8bcb5d76bd0c14cef22aece7493da7ba423
5-
63
on:
74
pull_request:
85
types: [opened, synchronize, reopened]
@@ -11,46 +8,24 @@ on:
118
jobs:
129
github-action:
1310
name: Github Actions
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout scanner registry
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0 # Need full history to detect changes
20-
- name: Run Tests
21-
uses: ${{ env.ACTION }}
22-
with:
23-
provider: github
24-
provider-config: |
25-
{
26-
"token": "${{ secrets.BOOST_GITHUB_TEST_RUNNER }}",
27-
"owner": "martin-boost-dev",
28-
"repo": "boostsec-registry-test-runner",
29-
"workflow_id": "test-scanner.yml"
30-
}
31-
registry-path: "."
32-
base-ref: "main"
33-
head-ref: "${{ github.head_ref }}"
11+
uses: ./.github/workflows/smoke-test-runner.yaml
12+
with:
13+
provider: github
14+
provider-config: |
15+
{
16+
"token": "${{ secrets.BOOST_GITHUB_TEST_RUNNER }}",
17+
"owner": "martin-boost-dev",
18+
"repo": "boostsec-registry-test-runner",
19+
"workflow_id": "test-scanner.yml"
20+
}
3421
3522
gitlab-action:
3623
name: Gitlab-ci
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Checkout scanner registry
40-
uses: actions/checkout@v4
41-
with:
42-
fetch-depth: 0 # Need full history to detect changes
43-
- name: Run Tests
44-
uses: ${{ env.ACTION }}
45-
with:
46-
provider: gitlab
47-
provider-config: |
48-
{
49-
"token": "${{ secrets.BOOST_GITLAB_TEST_RUNNER }}",
50-
"project_id": "boostsecurityio/martin/boostsec-registry-test-runner",
51-
"repo": "boostsec-registry-test-runner",
52-
"workflow_id": "test-scanner.yml"
53-
}
54-
registry-path: "."
55-
base-ref: "main"
56-
head-ref: "${{ github.head_ref }}"
24+
uses: ./.github/workflows/smoke-test-runner.yaml
25+
with:
26+
provider: gitlab
27+
provider-config: |
28+
{
29+
"token": "${{ secrets.BOOST_GITLAB_TEST_RUNNER }}",
30+
"project_id": "boostsecurityio/martin/boostsec-registry-test-runner"
31+
}

0 commit comments

Comments
 (0)