ci: Debug test job #125
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
--- | |
# From https://github.com/folke/lazy.nvim | |
name: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
stylua: | |
name: Stylua | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: JohnnyMorganz/stylua-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
args: --check lua | |
tests: | |
name: Run tests | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
# os: [ubuntu-latest, windows-latest] | |
os: [ubuntu-latest] | |
neovim_version: ["v0.9.5", "v0.10.2", "nightly"] | |
include: | |
- os: macos-latest | |
neovim_version: v0.10.2 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Neovim | |
uses: rhysd/action-setup-vim@v1 | |
with: | |
neovim: true | |
version: ${{ matrix.neovim_version }} | |
- name: Run Tests | |
run: | | |
nvim --version | |
env | |
OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') | |
echo $OS | |
if [[ "$OS" = "macos" ]]; then OS=darwin; fi | |
echo $OS | |
[ ! -d tests ] && exit 0 | |
curl -sLo /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-${OS}-amd64.tar.gz | |
tar -xC /tmp -f /tmp/kubeconform.tar.gz | |
mv /tmp/kubeconform /usr/local/bin/kubeconform | |
curl -sLo /tmp/kubent.tar.gz https://github.com/doitintl/kube-no-trouble/releases/download/0.7.0/kubent-0.7.0-${OS}-amd64.tar.gz | |
tar -xC /tmp -f /tmp/kubent.tar.gz | |
mv /tmp/kubent /usr/local/bin/kubent | |
nvim --headless --noplugin -u ./tests/init.lua -c "lua MiniTest.run()" | |
docs: | |
runs-on: ubuntu-latest | |
needs: tests | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: panvimdoc | |
uses: kdheepak/panvimdoc@main | |
with: | |
vimdoc: kustomize.nvim | |
version: "Neovim >= 0.9.0" | |
demojify: true | |
treesitter: true | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore(build): auto-generate vimdoc" | |
commit_user_name: "github-actions[bot]" | |
commit_user_email: "github-actions[bot]@users.noreply.github.com" | |
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | |
release: | |
name: release | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: | |
- docs | |
- tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
release-type: simple | |
package-name: kustomize.nvim | |
- uses: actions/checkout@v4 | |
- name: tag stable versions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.TOKEN }}@github.com/google-github-actions/release-please-action.git" | |
git tag -d stable || true | |
git push origin :stable || true | |
git tag -a stable -m "Last Stable Release" | |
git push origin stable |