diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 6b7bd82..d9d5420 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -8,16 +8,29 @@ jobs: permissions: contents: write steps: - - run: sudo add-apt-repository ppa:neovim-ppa/stable - - run: sudo apt-get update - - run: sudo apt-get install -y bash neovim pandoc - - run: rustup toolchain install stable --profile minimal --no-self-update - - run: cargo install garden-tools - - run: cargo install stylua + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 - uses: actions/checkout@v3 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} + - run: sudo add-apt-repository ppa:neovim-ppa/stable + - run: sudo apt-get update + - run: sudo apt-get install -y bash neovim pandoc + - run: date +%W >weekly + - name: Restore cache + id: cache + uses: actions/cache@v2 + with: + path: ~/.cargo/bin + key: ${{ runner.os }}-cargo-${{ hashFiles('weekly') }} + - run: rm -f weekly + - name: Install + if: steps.cache.outputs.cache-hit != 'true' + run: | + rustup toolchain install stable --profile minimal --no-self-update + cargo install garden-tools + cargo install stylua - name: Generate docs uses: kdheepak/panvimdoc@main with: @@ -26,12 +39,12 @@ jobs: pandoc: README.md toc: 'false' - run: garden -vv doc/post - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_author: cowcat commit_message: 'doc: generate vim docs' - run: garden -vv fmt - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_author: fatcat commit_message: 'lua: code formatting' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..10905f9 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,31 @@ +name: Test +on: [pull_request] +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + - uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + - run: sudo apt-get update + - run: sudo apt-get install luarocks -y + - run: sudo luarocks install luacheck + - run: date +%W >weekly + - name: Restore cache + id: cache + uses: actions/cache@v2 + with: + path: ~/.cargo/bin + key: ${{ runner.os }}-cargo-${{ hashFiles('weekly') }} + - run: rm -f weekly + - name: Install + if: steps.cache.outputs.cache-hit != 'true' + run: | + rustup toolchain install stable --profile minimal --no-self-update + cargo install garden-tools + cargo install stylua + - run: garden -vv check diff --git a/garden.yaml b/garden.yaml index 1e083ae..038ab41 100644 --- a/garden.yaml +++ b/garden.yaml @@ -24,8 +24,8 @@ trees: check>: - check/lua - check/fmt - check/fmt: garden fmt -- --check - check/lua: luacheck lua/* + check/fmt: garden -vv fmt -- --check + check/lua: luacheck lua doc: | panvimdoc.sh \ --description ' Telescope plugin for searching repositories using "git grep"' \