From a058bcaba18e8395b98ac8deb8dd717336282105 Mon Sep 17 00:00:00 2001 From: Omochice Date: Mon, 3 Jun 2024 22:08:17 +0900 Subject: [PATCH] ci --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d5dfe4..fe2e517 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,22 +45,48 @@ jobs: 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: 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 + - name: merge coverage + run: pnpm dlx cobertura@1.0.4 -o coverage.xml $(ls *.xml | sed 's/^\\(\\(coverage\\)-\(.*\\)\\.xml$/\\3=\\1/g') + - name: show + run: cat coverage.xml + upload-coverage-badge: runs-on: ubuntu-latest