ci: use aqua instead #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: checkout vim-themis | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
repository: thinca/vim-themis | |
path: vim-themis | |
- name: setup vim | |
id: vim | |
uses: rhysd/action-setup-vim@2ab97f992520b094d4243cde0d3173493c811799 # v1.3.4 | |
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 | |
- 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: | | |
rye sync | |
rye run covimerage write_coverage "${THEMIS_PROFILE}" | |
rye run 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" | |
- 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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
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@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
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 |