feat(ci): reorganize
This commit is contained in:
parent
b00f06377f
commit
6a6b048c6b
5 changed files with 47 additions and 39 deletions
9
.github/workflows/luarocks.yml
vendored
9
.github/workflows/luarocks.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: Push to Luarocks
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -7,11 +7,12 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
luarocks-upload:
|
||||
runs-on: ubuntu-22.04
|
||||
publish-luarocks:
|
||||
name: Publish to LuaRocks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: LuaRocks Upload
|
||||
- name: Publish to LuaRocks
|
||||
uses: nvim-neorocks/luarocks-tag-release@v7
|
||||
env:
|
||||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
name: ci
|
||||
name: Code Quality
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
|
@ -33,8 +33,9 @@ jobs:
|
|||
- 'tests/scrapers/**'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
|
||||
lua-format:
|
||||
name: Lua Formatting
|
||||
name: Lua Format Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
|
|
@ -47,7 +48,7 @@ jobs:
|
|||
args: --check .
|
||||
|
||||
lua-lint:
|
||||
name: Lua Linting
|
||||
name: Lua Lint Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
|
|
@ -60,7 +61,7 @@ jobs:
|
|||
args: --display-style quiet .
|
||||
|
||||
lua-typecheck:
|
||||
name: Lua Type Checking
|
||||
name: Lua Type Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
|
|
@ -74,7 +75,7 @@ jobs:
|
|||
configpath: .luarc.json
|
||||
|
||||
python-format:
|
||||
name: Python Formatting
|
||||
name: Python Format Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||
|
|
@ -88,7 +89,7 @@ jobs:
|
|||
run: ruff format --check scrapers/ tests/scrapers/
|
||||
|
||||
python-lint:
|
||||
name: Python Linting
|
||||
name: Python Lint Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||
|
|
@ -102,7 +103,7 @@ jobs:
|
|||
run: ruff check scrapers/ tests/scrapers/
|
||||
|
||||
python-typecheck:
|
||||
name: Python Type Checking
|
||||
name: Python Type Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||
|
|
@ -114,17 +115,3 @@ jobs:
|
|||
run: uv sync --dev
|
||||
- name: Type check Python files with mypy
|
||||
run: uv run mypy scrapers/ tests/scrapers/
|
||||
|
||||
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
|
||||
uses: astral-sh/setup-uv@v4
|
||||
- name: Install dependencies with pytest
|
||||
run: uv sync --dev
|
||||
- name: Run Python tests
|
||||
run: uv run pytest tests/scrapers/ -v
|
||||
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
|
|
@ -1,15 +1,17 @@
|
|||
name: Run tests
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request: ~
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
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
|
||||
|
|
@ -26,19 +28,37 @@ jobs:
|
|||
- '.luarc.json'
|
||||
- 'stylua.toml'
|
||||
- 'selene.toml'
|
||||
python:
|
||||
- 'scrapers/**'
|
||||
- 'tests/scrapers/**'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
|
||||
build:
|
||||
name: Run tests
|
||||
lua-test:
|
||||
name: Lua Tests (${{ matrix.neovim_version }})
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||
strategy:
|
||||
matrix:
|
||||
neovim_version: ['nightly', 'stable']
|
||||
|
||||
neovim_version: ['stable', 'nightly']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run tests
|
||||
- name: Run Lua tests
|
||||
uses: nvim-neorocks/nvim-busted-action@v1
|
||||
with:
|
||||
nvim_version: ${{ matrix.neovim_version }}
|
||||
|
||||
python-test:
|
||||
name: Python Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
- name: Install dependencies with pytest
|
||||
run: uv sync --dev
|
||||
- name: Run Python tests
|
||||
run: uv run pytest tests/scrapers/ -v
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ describe('cp.execute', function()
|
|||
end)
|
||||
|
||||
it('handles execution timeouts', function()
|
||||
vim.system = function(cmd, opts)
|
||||
vim.system = function(_, opts)
|
||||
if opts then
|
||||
assert.is_not_nil(opts.timeout)
|
||||
end
|
||||
|
|
@ -290,7 +290,7 @@ describe('cp.execute', function()
|
|||
end)
|
||||
|
||||
it('falls back to default language', function()
|
||||
vim.fn.fnamemodify = function(path, modifier)
|
||||
vim.fn.fnamemodify = function(_, modifier)
|
||||
if modifier == ':e' then
|
||||
return 'unknown'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ describe('cp integration', function()
|
|||
}
|
||||
|
||||
temp_files['test.run'] = {}
|
||||
vim.system = function(cmd)
|
||||
vim.system = function()
|
||||
return {
|
||||
wait = function()
|
||||
return { code = 0, stdout = '3\n', stderr = '' }
|
||||
|
|
@ -462,7 +462,7 @@ describe('cp integration', function()
|
|||
|
||||
it('maintains responsiveness during operations', function()
|
||||
local call_count = 0
|
||||
vim.system = function(cmd)
|
||||
vim.system = function()
|
||||
call_count = call_count + 1
|
||||
vim.wait(10)
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue