feat(ci): only run certain tests on change

This commit is contained in:
Barrett Ruth 2025-09-18 23:04:40 -04:00
parent f64b778835
commit abfa9011f7
2 changed files with 63 additions and 0 deletions

View file

@ -7,9 +7,37 @@ on:
branches: [main]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
lua: ${{ steps.changes.outputs.lua }}
python: ${{ steps.changes.outputs.python }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lua:
- 'lua/**'
- 'spec/**'
- 'plugin/**'
- 'after/**'
- 'ftdetect/**'
- '*.lua'
- '.luarc.json'
- 'stylua.toml'
- 'selene.toml'
python:
- 'scrapers/**'
- 'tests/scrapers/**'
- 'pyproject.toml'
- 'uv.lock'
lua-format:
name: Lua Formatting
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
@ -21,6 +49,8 @@ jobs:
lua-lint:
name: Lua Linting
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Lint with Selene
@ -32,6 +62,8 @@ jobs:
lua-typecheck:
name: Lua Type Checking
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Run Lua LS Type Check
@ -44,6 +76,8 @@ jobs:
python-format:
name: Python Formatting
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Install uv
@ -56,6 +90,8 @@ jobs:
python-lint:
name: Python Linting
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Install uv
@ -68,6 +104,8 @@ jobs:
python-typecheck:
name: Python Type Checking
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Install uv
@ -80,6 +118,8 @@ jobs:
python-test:
name: Python Testing
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Install uv

View file

@ -6,9 +6,32 @@ on:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
lua: ${{ steps.changes.outputs.lua }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lua:
- 'lua/**'
- 'spec/**'
- 'plugin/**'
- 'after/**'
- 'ftdetect/**'
- '*.lua'
- '.luarc.json'
- 'stylua.toml'
- 'selene.toml'
build:
name: Run tests
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
neovim_version: ['nightly', 'stable']