From 10d438d078804f407cfb6c6c60242776b6ce55d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rmet=20Yiltiz?= Date: Thu, 21 Dec 2023 13:48:41 -0500 Subject: [PATCH] update tests --- .github/workflows/main.yml | 40 +++++++++++++++++++-------------- .github/workflows/test-nvim.yml | 8 ++----- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36917ef0..9d2b1844 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,31 +20,37 @@ jobs: matrix: nvim-versions: ['stable', 'nightly'] steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Install NeoVim - uses: rhysd/action-setup-vim@v1 with: neovim: true version: ${{ matrix.nvim-versions }} - - name: Setup ‘lua’ - uses: leafo/gh-actions-lua@v8 - with: - luaVersion: '5.1.5' - - name: Setup ‘luarocks’ - uses: leafo/gh-actions-luarocks@v4 - - name: Install dependencies + - name: Checkout + - uses: actions/checkout@v3 + - name: Setup kitckstart and start nvim run: | - luarocks install luacheck - - name: Run linter - run: luacheck lua/ spec/ - - name: Run tests - run: make test - stylua: + ln -sf $GITHUB_WORKSPACE "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim + touch msg.log + nvim --headless -c ':Lazy! sync' -c ':qa' init.lua 2>&1 | tee -a msg.log + nvim --headless -c ':checkhealth' -c ':qa' init.lua 2>&1 | tee -a msg.log + echo -e '\n++++++++++++++++++++++++++++++' + cat msg.log + echo -e '++++++++++++++++++++++++++++++\n' + grep -i 'error' msg.log + if [ $? -eq 0 ]; then + exit 1 + else + exit 0 + fi + + stylua-check: name: Check codestyle runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: JohnnyMorganz/stylua-action@v3 + - name: Checkout Code + uses: actions/checkout@v4 + - name: Stylua Check + uses: JohnnyMorganz/stylua-action@v3 with: token: ${{ secrets.GITHUB_TOKEN }} version: latest diff --git a/.github/workflows/test-nvim.yml b/.github/workflows/test-nvim.yml index dda1503f..8bd908b0 100644 --- a/.github/workflows/test-nvim.yml +++ b/.github/workflows/test-nvim.yml @@ -9,6 +9,8 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + schedule: + - cron: '0 7 * * 1' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -51,9 +53,3 @@ jobs: else exit 0 fi - - - - - -