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 16, 2024
1 parent 45f90f1 commit a06beff
Show file tree
Hide file tree
Showing 4 changed files with 12 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 @@ -19,8 +19,6 @@ jobs:
fail-fast: false
name: Vim ${{ matrix.vim_version }} (${{ matrix.arch }})
runs-on: windows-latest
env:
PROFILE: profile.txt
timeout-minutes: 10
steps:
- name: Checkout code
Expand All @@ -41,20 +39,21 @@ 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
plugin: noop
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +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 a06beff

Please sign in to comment.