ci: add standard CI workflow
This commit is contained in:
24
.gitea/workflows/ci.yml
Normal file
24
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: CI
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Detect and lint
|
||||||
|
run: |
|
||||||
|
if [ -f package.json ]; then
|
||||||
|
npm ci --ignore-scripts 2>/dev/null || npm install --ignore-scripts
|
||||||
|
npx eslint . --ext .js,.ts,.jsx,.tsx --no-error-on-unmatched-pattern 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ -f requirements.txt ] || [ -f setup.py ] || [ -f pyproject.toml ]; then
|
||||||
|
pip install ruff 2>/dev/null
|
||||||
|
ruff check . 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if ls *.sh 2>/dev/null || ls **/*.sh 2>/dev/null; then
|
||||||
|
shellcheck *.sh **/*.sh 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
- name: Check syntax
|
||||||
|
run: |
|
||||||
|
find . -name "*.py" -exec python3 -c "import py_compile; py_compile.compile('{}', doraise=True)" \; 2>/dev/null || true
|
||||||
|
find . -name "*.sh" -exec bash -n {} \; 2>/dev/null || true
|
||||||
Reference in New Issue
Block a user