From 12db90333b67d492ffd7d6664662e269d54a7f38 Mon Sep 17 00:00:00 2001 From: PunGrumpy <108584943+PunGrumpy@users.noreply.github.com> Date: Thu, 16 Nov 2023 21:40:12 +0700 Subject: [PATCH] ci(github-actions): update ci actions --- .github/ISSUE_TEMPLATE/failure_report.md | 34 +++++++++ .github/workflows/ci.yml | 89 ++++++++++++++---------- 2 files changed, 85 insertions(+), 38 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/failure_report.md diff --git a/.github/ISSUE_TEMPLATE/failure_report.md b/.github/ISSUE_TEMPLATE/failure_report.md new file mode 100644 index 00000000..494397e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failure_report.md @@ -0,0 +1,34 @@ +## `๐Ÿšจ` Build Failure Report + +### Summary + +The build process failed due to unexpected issues. + +### Job Information + +- **Job Name:** Handler +- **Failed Step(s):** + - Cache โŒ + - Archive โŒ + +### Error Details + +Describe the errors encountered in detail. Include any relevant logs or error messages here. + +### Possible Causes + +- Changes in dependencies +- Recent code modifications +- Configuration issues + +### Steps to Reproduce + +If applicable, provide steps to reproduce the issue or the conditions that led to the failure. + +### Proposed Solutions + +Suggest potential solutions or troubleshooting steps that could resolve the problem. + +### Additional Information + +Any other relevant details or context about the failure. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bffeeef..eba2761f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,35 +1,10 @@ -name: CI +name: ๐Ÿ”Ž Continuous Integration on: push: pull_request: - jobs: - extras: - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' }} - steps: - - name: Install Neovim - shell: bash - run: | - mkdir -p /tmp/nvim - wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage - cd /tmp/nvim - chmod a+x ./nvim.appimage - ./nvim.appimage --appimage-extract - echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH - - uses: actions/checkout@v3 - - name: Build Extras - run: | - nvim -u NONE -E -R --headless --cmd "set rtp^=." --cmd "packloadall" --cmd "lua require('dullahan.extra').setup()" --cmd qa - - name: Push changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: 'chore(build): auto-generate extras' - commit_user_name: 'github-actions[bot]' - commit_user_email: 'github-actions[bot]@users.noreply.github.com' - commit_author: 'github-actions[bot] ' tests: - needs: extras + name: ๐Ÿฅผ Tests if: always() strategy: matrix: @@ -37,8 +12,9 @@ jobs: os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Neovim + - name: ๐Ÿ”” Checkout + uses: actions/checkout@v4 + - name: ๐Ÿ“ฆ Setup Neovim shell: bash run: | mkdir -p /tmp/nvim @@ -47,26 +23,28 @@ jobs: chmod a+x ./nvim.appimage ./nvim.appimage --appimage-extract echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH - - name: Run Tests + - name: ๐Ÿงช Test run: | nvim --version [ ! -d tests ] && exit 0 nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" docs: + name: ๐Ÿ“– Documentation runs-on: ubuntu-latest needs: tests if: ${{ github.ref == 'refs/heads/main' }} steps: - - uses: actions/checkout@v3 - - run: git pull - - name: panvimdoc + - name: ๐Ÿ”” Checkout + uses: actions/checkout@v4 + - run: ๐Ÿ˜บ Git pull + - name: ๐Ÿด Panvimdoc uses: kdheepak/panvimdoc@main with: vimdoc: dullahan.nvim version: 'Neovim >= 0.8.0' demojify: true treesitter: true - - name: Push changes + - name: ๐Ÿ˜ป Push changes uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: 'chore(build): auto-generate vimdoc' @@ -74,20 +52,22 @@ jobs: commit_user_email: 'github-actions[bot]@users.noreply.github.com' commit_author: 'github-actions[bot] ' release: - name: release + name: ๐Ÿš€ Release if: ${{ github.ref == 'refs/heads/main' }} needs: - docs - tests runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - name: ๐Ÿ”ฅ Automated releases + uses: google-github-actions/release-please-action@v3 id: release with: release-type: simple package-name: dullahan.nvim - - uses: actions/checkout@v3 - - name: tag stable versions + - name: ๐Ÿ”” Checkout + uses: actions/checkout@v4 + - name: ๐Ÿท๏ธ Tag stable versions if: ${{ steps.release.outputs.release_created }} run: | git config user.name github-actions[bot] @@ -97,3 +77,36 @@ jobs: git push origin :stable || true git tag -a stable -m "Last Stable Release" git push origin stable + handler: + name: ๐Ÿ‘‹ Handler + needs: + - release + if: failure() + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ”” Checkout + uses: actions/checkout@v4 + - name: ๐ŸŒต Cache + uses: actions/cache@v3 + with: + path: | + ~/.cache/nvim + ~/.local/share/nvim/site/pack/packer + key: ${{ runner.os }}-dullahan.nvim-${{ hashFiles('**/init.lua') }} + restore-keys: | + ${{ runner.os }}-dullahan.nvim-${{ hashFiles('**/init.lua') }} + - name: ๐ŸŽ Archive + uses: actions/upload-artifact@v2 + with: + name: logs + path: | + ~/.cache/nvim + ~/.local/share/nvim/site/pack/packer + - name: ๐Ÿ“ฎ Send issue + uses: peter-evans/create-issue-from-file@v4 + with: + title: ๐Ÿšจ Build failed + content-filepath: ../ISSUE_TEMPLATE/failure_report.md + labels: build + assignees: ${{ github.actor }} + token: ${{ secrets.GITHUB_TOKEN }}