Skip to content

Commit 5faf70f

Browse files
authored
fix: allow users to run only opa in a pipeline (#316)
1 parent 11cb87a commit 5faf70f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ and a [.golangci.yml](https://golangci-lint.run/usage/configuration/).
181181
| :---------------------------------------------- | :------ | -------- |
182182
| build-tags | x | |
183183
| code-coverage-expected | x | |
184+
| code-coverage-opa-expected | x | |
184185
| code-coverage-timeout | | |
185186
| github-token-for-downloading-private-go-modules | | |
186187
| golangci-timeout | x | |

action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
default: "80"
1010
description: |
1111
The minimum code coverage.
12+
code-coverage-opa-expected:
13+
default: "80"
14+
description: |
15+
The minimum OPA code coverage.
1216
code-coverage-timeout:
1317
description: |
1418
The duration before calculating the code-coverage times out.
@@ -97,6 +101,7 @@ runs:
97101
inputs.testing-type == 'integration' ||
98102
inputs.testing-type == 'lint' ||
99103
inputs.testing-type == 'mocks-tidy' ||
104+
inputs.testing-type == 'opa' ||
100105
inputs.testing-type == 'unit'
101106
with:
102107
go-version-file: ${{ inputs.go-version-file }}
@@ -112,6 +117,7 @@ runs:
112117
inputs.testing-type == 'lint' ||
113118
inputs.testing-type == 'mcvs-texttidy' ||
114119
inputs.testing-type == 'mocks-tidy' ||
120+
inputs.testing-type == 'opa' ||
115121
inputs.testing-type == 'unit'
116122
shell: bash
117123
run: |
@@ -247,6 +253,15 @@ runs:
247253
run: |
248254
task remote:mocks-tidy --yes
249255
#
256+
# Run Regal for linting and OPA.
257+
#
258+
- name: regal and opa
259+
if: inputs.testing-type == 'opa'
260+
shell: bash
261+
run: |
262+
task remote:regal --yes
263+
task remote:opa --yes
264+
#
250265
# Unit tests.
251266
#
252267
- name: unit tests

0 commit comments

Comments
 (0)