Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add octocov.yml #25

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
46 changes: 40 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,66 @@ jobs:
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.10'
- uses: aquaproj/aqua-installer@6ce1f8848ec8e61f14d57bd5d7597057a6dd187c # v3.0.1
with:
aqua_version: v2.28.1
- name: collect coverage
env:
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.neovim }}-${{ matrix.version }}.txt
run: |
pip install covimerage
pip install covimerage==0.2.2
covimerage write_coverage "${THEMIS_PROFILE}"
covimerage xml
- uses: k1LoW/octocov-action@5213913fe329368ab9dafa16f18f4f3cce1062f0 # v1.3.0
- name: create filename
id: filename
run: echo "filename=badge-${{ runner.os }}-$(test \"${{ matrix.neovim }}\" = \"true\" && echo neovim || echo vim )-${{ matrix.version }}" >> "$GITHUB_OUTPUT"
run: echo "filename=${{ runner.os }}-$(test \"${{ matrix.neovim }}\" = \"true\" && echo neovim || echo vim )-${{ matrix.version }}" >> "$GITHUB_OUTPUT"
- name: make covarage badge
run: |
octocov badge coverage --out ${{ github.workspace }}/${{ steps.filename.outputs.filename }}.svg
octocov badge coverage --out ${{ github.workspace }}/badge-${{ steps.filename.outputs.filename }}.svg
- name: upload badge to artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
path: ${{ steps.filename.outputs.filename }}.svg
name: ${{ steps.filename.outputs.filename }}
path: badge-${{ steps.filename.outputs.filename }}.svg
name: badge-${{ steps.filename.outputs.filename }}
if-no-files-found: error
- name: rename coverage.xml
run: mv coverage.xml coverage-${{ steps.filename.outputs.filename }}.xml
- name: upload coverage to artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
path: coverage-${{ steps.filename.outputs.filename }}.xml
name: coverage-${{ steps.filename.outputs.filename }}
if-no-files-found: error

report-coverage-metrics:
runs-on: ubuntu-latest
needs: themis
steps:
- name: checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: "coverage-*"
- name: extract
run: |
mv **/*.xml ./
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: merge coverage
run: pnpm dlx cobertura-merge@1.0.4 -o coverage.xml $(ls *.xml | sed 's/^\(\(coverage\)-\(.*\)\.xml\)$/\3=\1/g')
- uses: k1LoW/octocov-action@v1


upload-coverage-badge:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main')
needs: themis
steps:
- name: checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
Expand Down
16 changes: 16 additions & 0 deletions .octocov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# generated by octocov init
coverage:
if: true
testExecutionTime:
if: true
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
comment:
if: is_pull_request
summary:
if: true
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
15 changes: 15 additions & 0 deletions aqua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.188.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: k1LoW/octocov@v0.60.0
- name: astral-sh/rye@0.34.0
- name: astral-sh/uv@0.2.5