diff --git a/.github/workflows/luarocks.yml b/.github/workflows/luarocks.yml index 447c112..f3460d1 100644 --- a/.github/workflows/luarocks.yml +++ b/.github/workflows/luarocks.yml @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/quality.yml similarity index 82% rename from .github/workflows/ci.yml rename to .github/workflows/quality.yml index 02fadef..fc2c8b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/quality.yml @@ -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' }} @@ -113,18 +114,4 @@ jobs: - name: Install dependencies with mypy 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 + run: uv run mypy scrapers/ tests/scrapers/ \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7929abc..ebee51a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/spec/execute_spec.lua b/spec/execute_spec.lua index dfcd705..4ae93ba 100644 --- a/spec/execute_spec.lua +++ b/spec/execute_spec.lua @@ -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 diff --git a/spec/integration_spec.lua b/spec/integration_spec.lua index 86b9063..9ab1781 100644 --- a/spec/integration_spec.lua +++ b/spec/integration_spec.lua @@ -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 {