From 4ab19a8e374efdddb6de021342668999a5af8b6c Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Sat, 16 May 2026 00:29:31 +0200 Subject: [PATCH] separate all workflows, better overview --- .gitea/workflows/ci.yml | 89 -------------------------------- .gitea/workflows/format-js.yml | 28 ++++++++++ .gitea/workflows/lint-js.yml | 35 +++++++++++++ .gitea/workflows/lint-python.yml | 29 +++++++++++ .gitea/workflows/lint-qml.yml | 39 ++++++++++++++ .gitea/workflows/lint-rust.yml | 29 +++++++++++ 6 files changed, 160 insertions(+), 89 deletions(-) delete mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/format-js.yml create mode 100644 .gitea/workflows/lint-js.yml create mode 100644 .gitea/workflows/lint-python.yml create mode 100644 .gitea/workflows/lint-qml.yml create mode 100644 .gitea/workflows/lint-rust.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml deleted file mode 100644 index 2b9dbd9..0000000 --- a/.gitea/workflows/ci.yml +++ /dev/null @@ -1,89 +0,0 @@ -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: | - apk add --no-cache \ - bash \ - git \ - python3 \ - py3-pip \ - rust - edge_main="https://dl-cdn.alpinelinux.org/alpine/edge/main" - edge_community="https://dl-cdn.alpinelinux.org/alpine/edge/community" - apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative-dev-tools || \ - apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative-dev || \ - apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative || \ - 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: | - export PATH="$PATH:/usr/lib/qt6/bin:/usr/lib/qt6/libexec" - 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 diff --git a/.gitea/workflows/format-js.yml b/.gitea/workflows/format-js.yml new file mode 100644 index 0000000..4ad9cb8 --- /dev/null +++ b/.gitea/workflows/format-js.yml @@ -0,0 +1,28 @@ +name: Format (JS/TS) + +on: + pull_request: + +jobs: + format: + runs-on: alpine + container: node:20-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git + + - name: 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 diff --git a/.gitea/workflows/lint-js.yml b/.gitea/workflows/lint-js.yml new file mode 100644 index 0000000..1f4bea3 --- /dev/null +++ b/.gitea/workflows/lint-js.yml @@ -0,0 +1,35 @@ +name: Lint (JS/TS) + +on: + pull_request: + +jobs: + lint: + runs-on: alpine + container: node:20-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git + + - name: ESLint + 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 diff --git a/.gitea/workflows/lint-python.yml b/.gitea/workflows/lint-python.yml new file mode 100644 index 0000000..2bd74ec --- /dev/null +++ b/.gitea/workflows/lint-python.yml @@ -0,0 +1,29 @@ +name: Lint (Python) + +on: + pull_request: + +jobs: + lint: + runs-on: alpine + container: node:20-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + python3 \ + py3-pip + + - name: Ruff + run: | + python3 -m venv .venv + . .venv/bin/activate + pip install --no-cache-dir ruff + if ! ruff check .; then + echo "::warning::ruff reported issues" + fi diff --git a/.gitea/workflows/lint-qml.yml b/.gitea/workflows/lint-qml.yml new file mode 100644 index 0000000..3d77e4e --- /dev/null +++ b/.gitea/workflows/lint-qml.yml @@ -0,0 +1,39 @@ +name: Lint (QML) + +on: + pull_request: + +jobs: + lint: + runs-on: alpine + container: node:20-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git + edge_main="https://dl-cdn.alpinelinux.org/alpine/edge/main" + edge_community="https://dl-cdn.alpinelinux.org/alpine/edge/community" + apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative-dev-tools || \ + apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative-dev || \ + apk add --no-cache -X "$edge_main" -X "$edge_community" qt6-qtdeclarative || \ + echo "::warning::qmllint not available" + + - name: QML lint + run: | + export PATH="$PATH:/usr/lib/qt6/bin:/usr/lib/qt6/libexec" + 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 diff --git a/.gitea/workflows/lint-rust.yml b/.gitea/workflows/lint-rust.yml new file mode 100644 index 0000000..97d2adc --- /dev/null +++ b/.gitea/workflows/lint-rust.yml @@ -0,0 +1,29 @@ +name: Lint (Rust) + +on: + pull_request: + +jobs: + lint: + runs-on: alpine + container: node:20-alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: | + apk add --no-cache \ + git \ + rust + + - name: Rustfmt + run: | + if [ -f Cargo.toml ]; then + if ! cargo fmt --check; then + echo "::warning::rustfmt reported issues" + fi + else + echo "No Rust project found" + fi