-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (93 loc) · 3.32 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: vim-themis
on:
push:
paths-ignore:
- "README.md"
- "doc/*.txt"
pull_request:
jobs:
themis:
strategy:
fail-fast: false
matrix:
neovim: [false, true]
version: ["nightly", "stable"]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: checkout vim-themis
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
repository: thinca/vim-themis
path: vim-themis
- name: setup vim
id: vim
uses: rhysd/action-setup-vim@acff3bc31a82af69a26f90af710926fdab04d00e # v1.3.5
with:
neovim: ${{ matrix.neovim }}
version: ${{ matrix.version }}
- name: Run test with vim-themis
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.neovim }}-${{ matrix.version }}.txt
run: |
${GITHUB_WORKSPACE}/vim-themis/bin/themis --reporter dot
- name: setup python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: '3.10'
- name: collect coverage
env:
THEMIS_PROFILE: ${{ github.workspace }}/vim-profile-${{ runner.os }}-${{ matrix.neovim }}-${{ matrix.version }}.txt
run: |
pip install covimerage
covimerage write_coverage "${THEMIS_PROFILE}"
covimerage xml
- uses: k1LoW/octocov-action@1ad702b3118b6a055c00b01db68ca0d9f6641dbc # v1.4.0
- name: create filename
id: filename
run: echo "filename=badge-${{ 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
- name: upload badge to artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
path: ${{ steps.filename.outputs.filename }}.svg
name: ${{ steps.filename.outputs.filename }}
if-no-files-found: error
upload-coverage-badge:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main')
needs: themis
steps:
- name: download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: "badge-*"
- name: move them into docs
run: |
tree
mkdir docs
mv **/*.svg docs/
- name: upload badge to artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: docs
deploy-to-github-pages:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main')
needs: upload-coverage-badge
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5