feat(ci): only run certain tests on change
This commit is contained in:
parent
f64b778835
commit
abfa9011f7
2 changed files with 63 additions and 0 deletions
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
|
|
@ -7,9 +7,37 @@ on:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
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:
|
lua-format:
|
||||||
name: Lua Formatting
|
name: Lua Formatting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: JohnnyMorganz/stylua-action@v4
|
- uses: JohnnyMorganz/stylua-action@v4
|
||||||
|
|
@ -21,6 +49,8 @@ jobs:
|
||||||
lua-lint:
|
lua-lint:
|
||||||
name: Lua Linting
|
name: Lua Linting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Lint with Selene
|
- name: Lint with Selene
|
||||||
|
|
@ -32,6 +62,8 @@ jobs:
|
||||||
lua-typecheck:
|
lua-typecheck:
|
||||||
name: Lua Type Checking
|
name: Lua Type Checking
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Run Lua LS Type Check
|
- name: Run Lua LS Type Check
|
||||||
|
|
@ -44,6 +76,8 @@ jobs:
|
||||||
python-format:
|
python-format:
|
||||||
name: Python Formatting
|
name: Python Formatting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
|
|
@ -56,6 +90,8 @@ jobs:
|
||||||
python-lint:
|
python-lint:
|
||||||
name: Python Linting
|
name: Python Linting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
|
|
@ -68,6 +104,8 @@ jobs:
|
||||||
python-typecheck:
|
python-typecheck:
|
||||||
name: Python Type Checking
|
name: Python Type Checking
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
|
|
@ -80,6 +118,8 @@ jobs:
|
||||||
python-test:
|
python-test:
|
||||||
name: Python Testing
|
name: Python Testing
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
|
|
|
||||||
23
.github/workflows/test.yml
vendored
23
.github/workflows/test.yml
vendored
|
|
@ -6,9 +6,32 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
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:
|
build:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
neovim_version: ['nightly', 'stable']
|
neovim_version: ['nightly', 'stable']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue