Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Add tests using themis on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matts966 committed Jan 30, 2021
1 parent 4b9c002 commit cc87aa6
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
vim_type: ['Vim'] # , 'Neovim']
version: ['head', 'stable']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
include:
- vim_type: 'Vim'
version: 'stable'
vim_version: 'v8.2.0000'
runs-on: '${{ matrix.os }}'
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/checkout@v2'
with:
repository: thinca/vim-themis
path: vim-themis
- name: 'Setup Vim'
id: 'vim'
uses: 'thinca/action-setup-vim@v1'
with:
vim_version: '${{ matrix.vim_version || matrix.version }}'
vim_type: '${{ matrix.vim_type }}'
- name: Write gh cli config file for test and check path
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
import os
import subprocess
from os.path import expanduser
process = subprocess.Popen(["gh", "auth", "login", "--with-token"], stdin=subprocess.PIPE)
process.communicate(input=os.environ["TOKEN"].encode())
retcode = process.poll()
if retcode:
exit(1)
home = expanduser("~")
with open(os.path.join(home, ".config", "gh", "hosts.yml")) as cfg:
assert cfg.read()
shell: python
- name: Run unit tests with themis.vim
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis -r
7 changes: 7 additions & 0 deletions test/gh/gh.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let s:suite = themis#suite('gh')
let s:assert = themis#helper('assert')

function! s:suite.test_get_gh_token()
let gh_token = gh#gh#get_token()
call s:assert.false(empty(gh_token))
endfunction

0 comments on commit cc87aa6

Please sign in to comment.