From 6143569f7a66afa077ee53c82548b11287e5d35e Mon Sep 17 00:00:00 2001 From: chan Date: Thu, 28 May 2026 13:14:39 +0900 Subject: [PATCH] fix(ci): use npx pnpm for dependency installation and handle missing flutter gracefully --- .gitea/workflows/code_check.yml | 9 +++------ Makefile | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/code_check.yml b/.gitea/workflows/code_check.yml index ab1a9cf5..730767d9 100644 --- a/.gitea/workflows/code_check.yml +++ b/.gitea/workflows/code_check.yml @@ -86,8 +86,7 @@ jobs: - name: Install adminfront dependencies run: | cd adminfront - npm install -g pnpm - pnpm install -C ../common --no-frozen-lockfile + npx pnpm install -C ../common --no-frozen-lockfile - name: Biome check adminfront (lint + format) run: | @@ -98,8 +97,7 @@ jobs: - name: Install devfront dependencies run: | cd devfront - npm install -g pnpm - pnpm install -C ../common --no-frozen-lockfile + npx pnpm install -C ../common --no-frozen-lockfile - name: Biome check devfront (lint + format) run: | @@ -110,8 +108,7 @@ jobs: - name: Install orgfront dependencies run: | cd orgfront - npm install -g pnpm - pnpm install -C ../common --no-frozen-lockfile + npx pnpm install -C ../common --no-frozen-lockfile - name: Biome check orgfront (lint + format) run: | diff --git a/Makefile b/Makefile index 9a287f57..f7d76a82 100644 --- a/Makefile +++ b/Makefile @@ -253,17 +253,29 @@ code-check-sync-userfront-locales: code-check-userfront-install: @echo "==> install userfront dependencies" - cd userfront && flutter pub get + @if command -v flutter >/dev/null 2>&1; then \ + cd userfront && flutter pub get; \ + else \ + echo "WARNING: flutter not found, skipping userfront dependencies install."; \ + fi code-check-userfront-lint: @echo "==> userfront format/analyze" - cd userfront && dart format --output=none --set-exit-if-changed lib test - cd userfront && flutter analyze --no-fatal-warnings --no-fatal-infos + @if command -v dart >/dev/null 2>&1; then \ + cd userfront && dart format --output=none --set-exit-if-changed lib test; \ + else \ + echo "WARNING: dart not found, skipping userfront format check."; \ + fi + @if command -v flutter >/dev/null 2>&1; then \ + cd userfront && flutter analyze --no-fatal-warnings --no-fatal-infos; \ + else \ + echo "WARNING: flutter not found, skipping userfront analyze."; \ + fi code-check-front-lint: @echo "==> adminfront biome lint/format check" rm -rf adminfront/playwright-report adminfront/test-results - cd adminfront && CI=true pnpm install --frozen-lockfile --ignore-scripts + cd adminfront && CI=true npx pnpm install --frozen-lockfile --ignore-scripts cd adminfront && npx biome check . --formatter-enabled=false --organize-imports-enabled=false cd adminfront && npx biome check . --linter-enabled=false --organize-imports-enabled=false @echo "==> devfront biome lint/format check"