This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests using themis on github actions
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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
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 |