Skip to content

Commit

Permalink
Use Primula for code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hattya committed Apr 13, 2024
1 parent 6980d44 commit c404413
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
fail-fast: false
name: Vim ${{ matrix.vim_version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
env:
PROFILE: profile.txt
timeout-minutes: 10
steps:
- name: Checkout code
Expand All @@ -58,21 +56,22 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install covimerage
- name: Install Primula
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U covimerage
python -m pip install -U pip
python -m pip install -U primula
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis --reporter spec
- name: Generate XML coverage report
run: |
covimerage write_coverage ${{ env.PROFILE }}
covimerage xml
primula run ./vim-themis/bin/themis --reporter spec
primula report -m
- name: Generate XML coverage report
run: primula xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: ${{ matrix.platform }}
plugin: noop
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.html
*.sw?
.coverage_*
.coverage
profile.txt
tags
16 changes: 3 additions & 13 deletions Asterfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
var os = require('os');
var path = require('path');
var vimscript = require('language/vimscript');
var themis = vimscript.themis;
var covimerage = vimscript.covimerage;
var primula = vimscript.primula;
var rst2html = require('language/restructuredtext').rst2html;

var title = 'Aster ☆ ' + path.basename(os.getwd());
Expand All @@ -11,17 +10,8 @@ aster.title(title);

// vim
aster.watch(/.+\.(?:vim|vimspec|themisrc)$/, function() {
var prof = 'profile.txt';
var cover = os.whence('covimerage');
if (cover) {
os.setenv('PROFILE', prof);
}

themis('--reporter', 'dot');
if (cover) {
covimerage.write_coverage(prof);
covimerage.report();
}
primula.run('themis', '--reporter', 'dot');
primula.report('-m');
});

// rst
Expand Down

0 comments on commit c404413

Please sign in to comment.