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

Add tests using themis on github actions #82

Merged
merged 6 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: test

# Controls when the action will run.
on: push
# 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:
neovim: [false, true]
version: ['nightly', 'stable']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
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: rhysd/action-setup-vim@v1
with:
neovim: ${{ matrix.neovim }}
version: ${{ matrix.version }}
- 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))
skanehira marked this conversation as resolved.
Show resolved Hide resolved
endfunction