Skip to content

Commit

Permalink
chore: adjust workflow and remove more old js files
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Jul 8, 2023
1 parent 4c0442a commit a39c881
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 161 deletions.
27 changes: 0 additions & 27 deletions .eslintrc.js

This file was deleted.

121 changes: 50 additions & 71 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,10 @@ jobs:
name: Vim
strategy:
matrix:
# os: [macos-latest, ubuntu-20.04, windows-latest]
os: [macos-latest, ubuntu-20.04]
os: [ubuntu-latest]
vim-version: [v7.4.2119, v8.2.5172]
include:
- node-version: 16
- os: macos-latest
target: macos
- os: ubuntu-20.04
target: linux
# - os: windows-latest
# target: win
runs-on: ${{ matrix.os }}
steps:
- name: Install FUSE for linux
if: matrix.target == 'linux'
run: sudo apt-get install libfuse2
- name: Checkout kkoomen/vim-doge
uses: actions/checkout@v2
with:
Expand All @@ -38,17 +26,8 @@ jobs:
with:
repository: junegunn/vader.vim
path: vader.vim
- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-save --verbose
- name: Build Unix binary
if: matrix.target != 'win'
run: npm run build:binary:unix
- name: Build Windows binary
if: matrix.target == 'win'
run: npm run build:binary:windows
- run: rustup update stable && rustup default stable
- run: ./scripts/build.sh
- name: Setup vim
uses: thinca/action-setup-vim@v1
id: vim
Expand All @@ -59,51 +38,51 @@ jobs:
run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}"
shell: bash

tests_neovim:
name: NeoVim
strategy:
matrix:
os: [macos-latest, ubuntu-20.04]
vim-version: [v0.3.2, head]
include:
- node-version: 16
- os: macos-latest
target: macos
- os: ubuntu-20.04
target: linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout kkoomen/vim-doge
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout junegunn/vader.vim
uses: actions/checkout@v2
with:
repository: junegunn/vader.vim
path: vader.vim
- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-save --verbose
- name: Build binary
run: npm run build:binary:unix
- name: Setup neovim
uses: thinca/action-setup-vim@v1
id: vim
with:
vim_version: ${{ matrix.vim-version }}
vim_type: neovim
- name: Run tests
run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}"
shell: bash
# tests_neovim:
# name: NeoVim
# strategy:
# matrix:
# os: [ubuntu-latest]
# vim-version: [v0.3.2, head]
# include:
# - node-version: 16
# - os: macos-latest
# target: macos
# - os: ubuntu-20.04
# target: linux
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout kkoomen/vim-doge
# uses: actions/checkout@v2
# with:
# submodules: true
# - name: Checkout junegunn/vader.vim
# uses: actions/checkout@v2
# with:
# repository: junegunn/vader.vim
# path: vader.vim
# - name: Setup nodejs
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm ci --no-save --verbose
# - name: Build binary
# run: npm run build:binary:unix
# - name: Setup neovim
# uses: thinca/action-setup-vim@v1
# id: vim
# with:
# vim_version: ${{ matrix.vim-version }}
# vim_type: neovim
# - name: Run tests
# run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}"
# shell: bash

vint:
name: Linter
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- run: pip install vim-vint
- run: vint -s ./autoload ./plugin
# vint:
# name: Linter
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v1
# - run: pip install vim-vint
# - run: vint -s ./autoload ./plugin
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

28 changes: 0 additions & 28 deletions .release-it.json

This file was deleted.

1 change: 0 additions & 1 deletion .version

This file was deleted.

12 changes: 6 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
set -e
set -u

echo "System info:"
uname -a

ROOT_DIR=$(cd "$(dirname "$0")/.."; pwd -P)
OUTFILE="${1:-}"

Expand All @@ -16,15 +13,18 @@ cd $ROOT_DIR
[[ -e ./bin/vim-doge ]] && rm -f ./bin/vim-doge

# Build the binary.
npx caxa --input "$ROOT_DIR/build" --output "./bin/vim-doge" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/index.js"
cd $ROOT_DIR/helper
cargo build --release
cp target/release/vim-doge-helper $ROOT_DIR/bin/
cd $ROOT_DIR

# Archive the binary.
if [[ "$OUTFILE" != "" ]]; then
OUTFILE="$OUTFILE.tar.gz"
cd $ROOT_DIR/bin
rm -f ./*.tar.gz
echo "==> Archiving $ROOT_DIR/bin/vim-doge -> $ROOT_DIR/bin/$OUTFILE"
tar -czf "$OUTFILE" vim-doge
tar -czf "$OUTFILE" vim-doge-helper
fi

echo "🎉 Done building vim-doge binaries"
echo "🎉 Done building vim-doge-helper"
18 changes: 3 additions & 15 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ if (Test-Path $outFile) {
rm "$outFile"
}

try {
Invoke-WebRequest -uri $downloadUrl -OutFile ( New-Item -Path "$assetPath" -Force )
Expand-Archive -LiteralPath "$assetPath" -DestinationPath "$rootDir\bin"
rm "$assetPath"
} catch {
echo "No release found for vim-doge for Windows."
echo "This is due to a bug in node-gyp which doesn't allow vim-doge to be build for Windows."
echo ""
echo "Currently, the latest stable release for Windows is v3.11.0."
echo ""
echo "HOW TO INSTALL v3.11.0:"
echo "- Download the latest release from: https://github.com/kkoomen/vim-doge/releases/download/v3.11.0/vim-doge-win64.zip"
echo "- Unzip the vim-doge-win64.zip"
echo "- Put the vim-doge binary inside ~/path/to/vim-doge/bin/ (e.g. vim-plug would be: ~/.vim/plugged/vim-doge/bin/)"
}
Invoke-WebRequest -uri $downloadUrl -OutFile ( New-Item -Path "$assetPath" -Force )
Expand-Archive -LiteralPath "$assetPath" -DestinationPath "$rootDir\bin"
rm "$assetPath"
16 changes: 8 additions & 8 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ else
exit 127
fi

if [ -e ./bin/vim-doge ]; then
rm -f ./bin/vim-doge
if [ -e ./bin/vim-doge-helper ]; then
rm -f ./bin/vim-doge-helper
fi


Expand All @@ -24,14 +24,14 @@ cd "$ROOT_DIR"
[ ! -d ./bin ] && mkdir ./bin

OS="$(uname)"
OUTFILE="$ROOT_DIR/bin/vim-doge"
PKG_VERSION=$(cat "$ROOT_DIR/.version")
RELEASE_URL="https://github.com/kkoomen/vim-doge/releases/download/$PKG_VERSION"
OUTFILE="$ROOT_DIR/bin/vim-doge-helper"
APP_VERSION=$(cat helper/Cargo.toml | grep version | head -n 1 | sed -E 's/version = "([0-9]+.[0-9]+.[0-9]+)"/\1/')
RELEASE_URL="https://github.com/kkoomen/vim-doge/releases/download/$APP_VERSION"

if [ $OS = 'Darwin' ]; then
TARGET="vim-doge-macos"
TARGET="vim-doge-helper-macos"
elif [ $OS = 'Linux' ]; then
TARGET="vim-doge-linux"
TARGET="vim-doge-helper-linux"
else
echo "vim-doge does not support your system"
exit 1
Expand All @@ -44,6 +44,6 @@ curl -L --progress-bar \
--fail \
--output "$FILENAME" \
"$DOWNLOAD_URL"
tar xzf "$FILENAME" && mv "vim-doge" "$OUTFILE"
tar xzf "$FILENAME" && mv "vim-doge-helper" "$OUTFILE"
rm -f "$FILENAME"
chmod +x "$OUTFILE"

0 comments on commit a39c881

Please sign in to comment.