Files
z-bar-qt/.gitea/workflows/ci.yml
T
AramJonghu 17fb9c0fef
CI (Lint + Format Checks) / lint (pull_request) Successful in 41s
apline-edge for qmllint
2026-05-16 00:24:06 +02:00

88 lines
2.8 KiB
YAML

name: CI (Lint + Format Checks)
on:
pull_request:
jobs:
lint:
runs-on: alpine
container: node:20-alpine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tools
run: |
echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk update
apk add --no-cache \
bash \
git \
python3 \
py3-pip \
rust
apk add --no-cache qt6-qtdeclarative-dev-tools || \
echo "::warning::qmllint not available"
- name: Python lint
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install --no-cache-dir ruff
if ! ruff check .; then
echo "::warning::ruff reported issues"
fi
- name: JS lint
run: |
if [ -n "$(find . -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.mjs" -o -name "*.cjs" -print -quit)" ]; then
if [ -f package.json ]; then
npm install --no-audit --no-fund
fi
if [ -f eslint.config.js ] || [ -f eslint.config.mjs ] || [ -f eslint.config.cjs ] || [ -f .eslintrc ] || [ -f .eslintrc.js ] || [ -f .eslintrc.cjs ] || [ -f .eslintrc.json ] || [ -f .eslintrc.yaml ] || [ -f .eslintrc.yml ]; then
if ! npx --yes eslint .; then
echo "::warning::eslint reported issues"
fi
else
echo "No eslint config found"
fi
else
echo "No JS/TS files found"
fi
- name: JS format (prettier)
run: |
if [ -n "$(find . -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.mjs" -o -name "*.cjs" -print -quit)" ]; then
if ! npx --yes prettier --check "**/*.{js,jsx,ts,tsx,mjs,cjs}" --ignore-path .gitignore; then
echo "::warning::prettier reported issues"
fi
else
echo "No JS/TS files found"
fi
- name: Rust lint
run: |
if [ -f Cargo.toml ]; then
if ! cargo fmt --check; then
echo "::warning::rustfmt reported issues"
fi
else
echo "No Rust project found"
fi
- name: QML lint
run: |
if command -v qmllint >/dev/null 2>&1; then
if [ -n "$(find . -name "*.qml" -print -quit)" ]; then
if ! find . -name "*.qml" -print0 | xargs -0 qmllint; then
echo "::warning::qmllint reported issues"
fi
else
echo "No QML files found"
fi
else
echo "No qmllint in PATH"
fi