feat(queries): implementation of regal for linting rego files #3463
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check-go-coverage | |
on: | |
pull_request: | |
branches: [master] | |
jobs: | |
coverage: | |
name: generate-coverage | |
runs-on: ubuntu-latest | |
outputs: | |
coverage: ${{ steps.testcov.outputs.coverage }} | |
color: ${{ steps.testcov.outputs.color }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run test metrics script | |
id: testcov | |
run: | | |
make test-coverage-report | tee test-results | |
TOTAL_TESTS=$(cat test-results | grep -v TestQueriesContent/ | grep -v TestQueriesMetadata/ | grep -v TestQueries/ | grep PASS | wc -l) | |
echo "Total number of tests :: ${TOTAL_TESTS}" | |
echo "::set-output name=total_tests::${TOTAL_TESTS}" | |
- name: Checks if Go coverage is at least 74% | |
if: steps.testcov.outputs.coverage < 74 | |
run: | | |
echo "Go coverage is lower than 74%: ${{ steps.testcov.outputs.coverage }}%" | |
exit 1 |