|
| 1 | +name: quality |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + changes: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + outputs: |
| 13 | + lua: ${{ steps.changes.outputs.lua }} |
| 14 | + markdown: ${{ steps.changes.outputs.markdown }} |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - uses: dorny/paths-filter@v3 |
| 18 | + id: changes |
| 19 | + with: |
| 20 | + filters: | |
| 21 | + lua: |
| 22 | + - 'lua/**' |
| 23 | + - 'plugin/**' |
| 24 | + - '*.lua' |
| 25 | + - '.luarc.json' |
| 26 | + - '*.toml' |
| 27 | + markdown: |
| 28 | + - '*.md' |
| 29 | + - 'doc/**/*.md' |
| 30 | +
|
| 31 | + lua-format: |
| 32 | + name: Lua Format Check |
| 33 | + runs-on: ubuntu-latest |
| 34 | + needs: changes |
| 35 | + if: ${{ needs.changes.outputs.lua == 'true' }} |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: JohnnyMorganz/stylua-action@v4 |
| 39 | + with: |
| 40 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + version: 2.1.0 |
| 42 | + args: --check . |
| 43 | + |
| 44 | + lua-lint: |
| 45 | + name: Lua Lint Check |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: changes |
| 48 | + if: ${{ needs.changes.outputs.lua == 'true' }} |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - name: Lint with Selene |
| 52 | + uses: NTBBloodbath/selene-action@v1.0.0 |
| 53 | + with: |
| 54 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + args: --display-style quiet . |
| 56 | + |
| 57 | + lua-typecheck: |
| 58 | + name: Lua Type Check |
| 59 | + runs-on: ubuntu-latest |
| 60 | + needs: changes |
| 61 | + if: ${{ needs.changes.outputs.lua == 'true' }} |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - name: Run Lua LS Type Check |
| 65 | + uses: mrcjkb/lua-typecheck-action@v0 |
| 66 | + with: |
| 67 | + checklevel: Warning |
| 68 | + directories: lua |
| 69 | + configpath: .luarc.json |
| 70 | + |
| 71 | + markdown-format: |
| 72 | + name: Markdown Format Check |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: changes |
| 75 | + if: ${{ needs.changes.outputs.markdown == 'true' }} |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + - name: Setup pnpm |
| 79 | + uses: pnpm/action-setup@v4 |
| 80 | + with: |
| 81 | + version: 8 |
| 82 | + - name: Setup Node.js |
| 83 | + uses: actions/setup-node@v4 |
| 84 | + with: |
| 85 | + node-version: "20" |
| 86 | + - name: Install prettier |
| 87 | + run: pnpm add -g prettier@3.1.0 |
| 88 | + - name: Check markdown formatting with prettier |
| 89 | + run: prettier --check . |
0 commit comments