Use json coverage data as it already exists to avoid duplication #8
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: Main | |
on: | |
push: | |
env: | |
KOSLI_DRY_RUN: ${{ vars.KOSLI_DRY_RUN }} # false | |
KOSLI_HOST: ${{ vars.KOSLI_HOST }} # https://app.kosli.com | |
KOSLI_ORG: ${{ vars.KOSLI_ORG }} # cyber-dojo | |
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }} | |
jobs: | |
create-kosli-attestation-types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup Kosli CLI | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: kosli-dev/setup-cli-action@v2 | |
with: | |
version: ${{ vars.KOSLI_CLI_VERSION }} | |
- name: Create test metrics attestation type | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | |
kosli create attestation-type test-metrics | |
--schema=metrics-test.schema.json | |
--jq ".test_count >= 1" | |
--jq ".failure_count == 0" | |
--jq ".error_count == 0" | |
--jq ".skip_count == 0" | |
- name: Create coverage metrics attestation type | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | |
kosli create attestation-type coverage-metrics | |
--schema=metrics-coverage.schema.json | |
--jq ".test.lines.total >= 1" | |
--jq ".test.lines.missed == 0" | |
--jq ".test.branches.total <= 20" | |
--jq ".test.branches.missed == 0" | |
--jq ".code.branches.total <= 200" |