Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
chore(ci): add test bootstrap in github action (#1)
Browse files Browse the repository at this point in the history
* chore(ci): add test bootstrap in github action

* feat(bootstrap): create ismachine function

[-] isDarwin
[-] isLinux
[+] isMachine string

* feat(vim): use silent! for colorscheme

when use silent! we ignore an error E185 in vim
  • Loading branch information
r17x authored Mar 20, 2021
1 parent c821e46 commit 0161ce3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
15 changes: 8 additions & 7 deletions .config/yadm/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ getMachine () {
esac
echo "$machine"
}
isLinux () {
[ $(getMachine) == "linux" ]; return $?;
}
isDarwin () {
[ $(getMachine) == "darwin" ]; return $?;
isMachine () {
if [ $(getMachine) = $1 ];then
return 0;
fi
return 1;
}
### Machine portable detect ###
wantTo () {
Expand Down Expand Up @@ -54,10 +54,11 @@ bootstrap_Homebrew () {
### Greeting Machine ###
echo "You're Machine is: $(getMachine)"
### When is Linux based ###
if isLinux; then
if isMachine "linux"; then
wantTo "VIM" && bootstrap_VIM
fi
### When is Darwin based ###
if isDarwin; then
if isMachine "darwin"; then
wantTo "HOMEBREW" && bootstrap_Homebrew
wantTo "VIM" && bootstrap_VIM
fi
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [pull_request]

jobs:
linux:
name: bootstrap test linux
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- run: sudo apt-get install yadm
- run: yadm clone https://github.com/ri7nz/.dotifiles
- run: yadm checkout ${{ github.head_ref }}
- run: yadm bootstrap
mac:
name: bootstrap test mac
runs-on: macos-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- run: brew install yadm
- run: yadm clone https://github.com/ri7nz/.dotifiles
- run: yadm checkout ${{ github.head_ref }}
- run: yadm bootstrap
2 changes: 1 addition & 1 deletion .vim/vimrc.d/__3theme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ let g:lightline = {
if (has("termguicolors"))
set termguicolors
endif
colorscheme edge
silent! colorscheme edge

0 comments on commit 0161ce3

Please sign in to comment.