Merge pull request #220 from barrettruth/fix/ci
run luarocks build on successful ci
This commit is contained in:
commit
9daa4e4ec4
2 changed files with 121 additions and 11 deletions
111
.github/workflows/ci.yaml
vendored
Normal file
111
.github/workflows/ci.yaml
vendored
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
name: ci
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
push:
|
||||||
|
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:
|
||||||
|
- 'scripts/**'
|
||||||
|
- 'scrapers/**'
|
||||||
|
- 'tests/**'
|
||||||
|
- 'pyproject.toml'
|
||||||
|
- 'uv.lock'
|
||||||
|
|
||||||
|
lua-format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: JohnnyMorganz/stylua-action@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
version: 2.1.0
|
||||||
|
args: --check .
|
||||||
|
|
||||||
|
lua-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: NTBBloodbath/selene-action@v1.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
args: --display-style quiet .
|
||||||
|
|
||||||
|
lua-typecheck:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.lua == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: mrcjkb/lua-typecheck-action@v0
|
||||||
|
with:
|
||||||
|
checklevel: Warning
|
||||||
|
directories: lua
|
||||||
|
configpath: .luarc.json
|
||||||
|
|
||||||
|
python-format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/setup-uv@v4
|
||||||
|
- run: uv tool install ruff
|
||||||
|
- run: ruff format --check .
|
||||||
|
|
||||||
|
python-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/setup-uv@v4
|
||||||
|
- run: uv tool install ruff
|
||||||
|
- run: ruff check .
|
||||||
|
|
||||||
|
python-typecheck:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/setup-uv@v4
|
||||||
|
- run: uv sync --dev
|
||||||
|
- run: uvx ty check .
|
||||||
|
|
||||||
|
python-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/setup-uv@v4
|
||||||
|
- run: uv sync --dev
|
||||||
|
- run: uv run camoufox fetch
|
||||||
|
- run: uv run pytest tests/ -v
|
||||||
21
.github/workflows/luarocks.yaml
vendored
21
.github/workflows/luarocks.yaml
vendored
|
|
@ -1,18 +1,17 @@
|
||||||
name: Release
|
name: luarocks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_run:
|
||||||
tags:
|
workflows: ["ci"]
|
||||||
- '*'
|
types:
|
||||||
workflow_dispatch:
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-luarocks:
|
publish:
|
||||||
name: Publish to LuaRocks
|
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Publish to LuaRocks
|
with:
|
||||||
uses: nvim-neorocks/luarocks-tag-release@v7
|
ref: ${{ github.event.workflow_run.head_sha }}
|
||||||
|
- uses: nvim-neorocks/luarocks-tag-release@v7
|
||||||
env:
|
env:
|
||||||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
|
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue