From 6d66c1e4576f8f721d59f0a02bb6ddef8a00aa79 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 12:32:33 +0900 Subject: [PATCH 1/8] Add workspace-detector workflow --- .github/workflows/workspace-detector.yaml | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 .github/workflows/workspace-detector.yaml diff --git a/.github/workflows/workspace-detector.yaml b/.github/workflows/workspace-detector.yaml new file mode 100644 index 00000000..809c579a --- /dev/null +++ b/.github/workflows/workspace-detector.yaml @@ -0,0 +1,150 @@ +name: workspace-detector +on: + pull_request: + push: + branches: + - workspace-detector + workflow_dispatch: + +jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + changed_workspaces: ${{ steps.detect.outputs.changed_workspaces }} + changed_workspaces_json: ${{ steps.detect.outputs.changed_workspaces_json }} + all_workspaces: ${{ steps.detect.outputs.all_workspaces }} + has_changes: ${{ steps.detect.outputs.has_changes }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: ./.github/actions/setup-mise + + - name: Detect changed workspaces + id: detect + run: | + set -e + + # Determine base commit for comparison + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + # For push events, compare with previous commit + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + # First commit in repository + base_ref="" + fi + fi + + echo "Base ref: $base_ref" + echo "" + + # Use pnpm to detect changed workspaces + if [[ -n "$base_ref" ]]; then + # Get list of changed workspaces using pnpm --filter + # The [...$base_ref] syntax filters to packages that have changes since base_ref + changed_output=$(pnpm list --recursive --depth -1 --filter "...[${base_ref}]" --json 2>/dev/null || echo "[]") + else + # First commit - all workspaces are considered changed + changed_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") + fi + + echo "Changed packages output:" + echo "$changed_output" | jq . + echo "" + + # Extract workspace paths from pnpm output + changed_workspaces=$(echo "$changed_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") + + # Convert to array + readarray -t changed_array <<< "$changed_workspaces" + + # Filter out empty entries + filtered_changed=() + for ws in "${changed_array[@]}"; do + if [[ -n "$ws" ]]; then + filtered_changed+=("$ws") + echo "✓ Changed: $ws" + fi + done + + echo "" + + # Get all workspaces for reference + all_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") + all_workspaces=$(echo "$all_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") + + # Output results + if [[ ${#filtered_changed[@]} -eq 0 ]]; then + echo "No workspace changes detected" + echo "changed_workspaces=" >> "$GITHUB_OUTPUT" + echo "changed_workspaces_json=[]" >> "$GITHUB_OUTPUT" + echo "has_changes=false" >> "$GITHUB_OUTPUT" + else + echo "Changed workspaces: ${filtered_changed[*]}" + # Output as space-separated string + echo "changed_workspaces=${filtered_changed[*]}" >> "$GITHUB_OUTPUT" + # Output as JSON array (compact format, no newlines) + json_array=$(printf '%s\n' "${filtered_changed[@]}" | jq -R . | jq -s -c .) + echo "changed_workspaces_json=$json_array" >> "$GITHUB_OUTPUT" + echo "has_changes=true" >> "$GITHUB_OUTPUT" + fi + + # Output all workspaces for reference (compact format, no newlines) + all_workspaces_json=$(echo "$all_workspaces" | grep -v '^$' | jq -R . | jq -s -c . || echo "[]") + echo "all_workspaces=$all_workspaces_json" >> "$GITHUB_OUTPUT" + + - name: Display detection results + run: | + echo "## Workspace Change Detection Results" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + + if [[ "${{ steps.detect.outputs.has_changes }}" == "true" ]]; then + echo "### Changed Workspaces" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo '${{ steps.detect.outputs.changed_workspaces_json }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" + else + echo "No workspace changes detected." >> "$GITHUB_STEP_SUMMARY" + fi + + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "### All Workspaces" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo '${{ steps.detect.outputs.all_workspaces }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" + + # Example job showing how to use the detection results + example-conditional-job: + needs: detect-changes + if: needs.detect-changes.outputs.has_changes == 'true' + runs-on: ubuntu-latest + strategy: + matrix: + workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-mise + - name: Process changed workspace + run: | + echo "Processing workspace: ${{ matrix.workspace }}" + # Add workspace-specific commands here + # For example: + # cd "${{ matrix.workspace }}" && deno check . + # cd "${{ matrix.workspace }}" && deno test + # Or use pnpm filters: + # pnpm --filter "${{ matrix.workspace }}" test + + # Test @fedify/cli when packages/cli changes + test-cli-init: + needs: detect-changes + if: contains(needs.detect-changes.outputs.changed_workspaces, 'packages/cli') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-mise + - name: Run deno task test-init for @fedify/cli + run: | + cd packages/cli + deno task test-init From 4c4c7c225a77722a16ad3251c51d9f146c08cb68 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 14:21:15 +0900 Subject: [PATCH 2/8] Add rabbitMQ, Postgres, Redis container to test-cli-init --- .github/workflows/workspace-detector.yaml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/workspace-detector.yaml b/.github/workflows/workspace-detector.yaml index 809c579a..3b5ddb00 100644 --- a/.github/workflows/workspace-detector.yaml +++ b/.github/workflows/workspace-detector.yaml @@ -141,6 +141,40 @@ jobs: needs: detect-changes if: contains(needs.detect-changes.outputs.changed_workspaces, 'packages/cli') runs-on: ubuntu-latest + services: + rabbitmq: + image: rabbitmq + env: + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest + ports: + - 5672:5672 + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + env: + AMQP_URL: amqp://guest:guest@localhost:5672 + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-mise From e625e4812dc9a7c511d3d8a0a7778d354b17e630 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 15:49:46 +0900 Subject: [PATCH 3/8] Integrate detect-workspace to main.yaml --- .../detect-workspace-changes/action.yaml | 114 +++++++++++ .github/workflows/main.yaml | 63 ++++++ .github/workflows/workspace-detector.yaml | 184 ------------------ 3 files changed, 177 insertions(+), 184 deletions(-) create mode 100644 .github/actions/detect-workspace-changes/action.yaml delete mode 100644 .github/workflows/workspace-detector.yaml diff --git a/.github/actions/detect-workspace-changes/action.yaml b/.github/actions/detect-workspace-changes/action.yaml new file mode 100644 index 00000000..4cf4bd58 --- /dev/null +++ b/.github/actions/detect-workspace-changes/action.yaml @@ -0,0 +1,114 @@ +name: Detect Workspace Changes +description: Detects which workspace packages have changed using pnpm +outputs: + changed_workspaces: + description: "Space-separated list of changed workspace paths" + value: ${{ steps.detect.outputs.changed_workspaces }} + changed_workspaces_json: + description: "JSON array of changed workspace paths" + value: ${{ steps.detect.outputs.changed_workspaces_json }} + all_workspaces: + description: "JSON array of all workspace paths" + value: ${{ steps.detect.outputs.all_workspaces }} + has_changes: + description: "Whether any workspaces have changes" + value: ${{ steps.detect.outputs.has_changes }} + +runs: + using: composite + steps: + - name: Detect changed workspaces + id: detect + shell: bash + run: | + set -e + + # Determine base commit for comparison + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + # For push events, compare with previous commit + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + # First commit in repository + base_ref="" + fi + fi + + echo "Base ref: $base_ref" + echo "" + + # Use pnpm to detect changed workspaces + if [[ -n "$base_ref" ]]; then + # Get list of changed workspaces using pnpm --filter + # The [...$base_ref] syntax filters to packages that have changes since base_ref + changed_output=$(pnpm list --recursive --depth -1 --filter "...[${base_ref}]" --json 2>/dev/null || echo "[]") + else + # First commit - all workspaces are considered changed + changed_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") + fi + + echo "Changed packages output:" + echo "$changed_output" | jq . + echo "" + + # Extract workspace paths from pnpm output + changed_workspaces=$(echo "$changed_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") + + # Convert to array + readarray -t changed_array <<< "$changed_workspaces" + + # Filter out empty entries + filtered_changed=() + for ws in "${changed_array[@]}"; do + if [[ -n "$ws" ]]; then + filtered_changed+=("$ws") + echo "✓ Changed: $ws" + fi + done + + echo "" + + # Get all workspaces for reference + all_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") + all_workspaces=$(echo "$all_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") + + # Output results + if [[ ${#filtered_changed[@]} -eq 0 ]]; then + echo "No workspace changes detected" + echo "changed_workspaces=" >> "$GITHUB_OUTPUT" + echo "changed_workspaces_json=[]" >> "$GITHUB_OUTPUT" + echo "has_changes=false" >> "$GITHUB_OUTPUT" + else + echo "Changed workspaces: ${filtered_changed[*]}" + # Output as space-separated string + echo "changed_workspaces=${filtered_changed[*]}" >> "$GITHUB_OUTPUT" + # Output as JSON array (compact format, no newlines) + json_array=$(printf '%s\n' "${filtered_changed[@]}" | jq -R . | jq -s -c .) + echo "changed_workspaces_json=$json_array" >> "$GITHUB_OUTPUT" + echo "has_changes=true" >> "$GITHUB_OUTPUT" + fi + + # Output all workspaces for reference (compact format, no newlines) + all_workspaces_json=$(echo "$all_workspaces" | grep -v '^$' | jq -R . | jq -s -c . || echo "[]") + echo "all_workspaces=$all_workspaces_json" >> "$GITHUB_OUTPUT" + + - name: Display detection results + shell: bash + run: | + echo "## Workspace Change Detection Results" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + + if [[ "${{ steps.detect.outputs.has_changes }}" == "true" ]]; then + echo "### Changed Workspaces" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo '${{ steps.detect.outputs.changed_workspaces_json }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" + else + echo "No workspace changes detected." >> "$GITHUB_STEP_SUMMARY" + fi + + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "### All Workspaces" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo '${{ steps.detect.outputs.all_workspaces }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a2515661..bea8cd8d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,6 +14,23 @@ concurrency: cancel-in-progress: true jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + changed_workspaces: ${{ steps.detect.outputs.changed_workspaces }} + changed_workspaces_json: ${{ steps.detect.outputs.changed_workspaces_json }} + all_workspaces: ${{ steps.detect.outputs.all_workspaces }} + has_changes: ${{ steps.detect.outputs.has_changes }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: ./.github/actions/setup-mise + + - id: detect + uses: ./.github/actions/detect-workspace-changes + test: runs-on: ubuntu-latest permissions: @@ -172,6 +189,52 @@ jobs: - run: deno task test:cfworkers working-directory: ${{ github.workspace }}/packages/fedify/ + test-cli-init: + needs: detect-changes + if: contains(needs.detect-changes.outputs.changed_workspaces, 'packages/cli') + runs-on: ubuntu-latest + services: + rabbitmq: + image: rabbitmq + env: + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest + ports: + - 5672:5672 + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + env: + AMQP_URL: amqp://guest:guest@localhost:5672 + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + REDIS_URL: redis://localhost:6379 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-mise + - name: Run deno task test-init for @fedify/cli + run: | + cd packages/cli + deno task test-init + lint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/workspace-detector.yaml b/.github/workflows/workspace-detector.yaml deleted file mode 100644 index 3b5ddb00..00000000 --- a/.github/workflows/workspace-detector.yaml +++ /dev/null @@ -1,184 +0,0 @@ -name: workspace-detector -on: - pull_request: - push: - branches: - - workspace-detector - workflow_dispatch: - -jobs: - detect-changes: - runs-on: ubuntu-latest - outputs: - changed_workspaces: ${{ steps.detect.outputs.changed_workspaces }} - changed_workspaces_json: ${{ steps.detect.outputs.changed_workspaces_json }} - all_workspaces: ${{ steps.detect.outputs.all_workspaces }} - has_changes: ${{ steps.detect.outputs.has_changes }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: ./.github/actions/setup-mise - - - name: Detect changed workspaces - id: detect - run: | - set -e - - # Determine base commit for comparison - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - base_ref="${{ github.event.pull_request.base.sha }}" - else - # For push events, compare with previous commit - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - # First commit in repository - base_ref="" - fi - fi - - echo "Base ref: $base_ref" - echo "" - - # Use pnpm to detect changed workspaces - if [[ -n "$base_ref" ]]; then - # Get list of changed workspaces using pnpm --filter - # The [...$base_ref] syntax filters to packages that have changes since base_ref - changed_output=$(pnpm list --recursive --depth -1 --filter "...[${base_ref}]" --json 2>/dev/null || echo "[]") - else - # First commit - all workspaces are considered changed - changed_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") - fi - - echo "Changed packages output:" - echo "$changed_output" | jq . - echo "" - - # Extract workspace paths from pnpm output - changed_workspaces=$(echo "$changed_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") - - # Convert to array - readarray -t changed_array <<< "$changed_workspaces" - - # Filter out empty entries - filtered_changed=() - for ws in "${changed_array[@]}"; do - if [[ -n "$ws" ]]; then - filtered_changed+=("$ws") - echo "✓ Changed: $ws" - fi - done - - echo "" - - # Get all workspaces for reference - all_output=$(pnpm list --recursive --depth -1 --json 2>/dev/null || echo "[]") - all_workspaces=$(echo "$all_output" | jq -r '.[].path // empty' | sed "s|^$PWD/||" || echo "") - - # Output results - if [[ ${#filtered_changed[@]} -eq 0 ]]; then - echo "No workspace changes detected" - echo "changed_workspaces=" >> "$GITHUB_OUTPUT" - echo "changed_workspaces_json=[]" >> "$GITHUB_OUTPUT" - echo "has_changes=false" >> "$GITHUB_OUTPUT" - else - echo "Changed workspaces: ${filtered_changed[*]}" - # Output as space-separated string - echo "changed_workspaces=${filtered_changed[*]}" >> "$GITHUB_OUTPUT" - # Output as JSON array (compact format, no newlines) - json_array=$(printf '%s\n' "${filtered_changed[@]}" | jq -R . | jq -s -c .) - echo "changed_workspaces_json=$json_array" >> "$GITHUB_OUTPUT" - echo "has_changes=true" >> "$GITHUB_OUTPUT" - fi - - # Output all workspaces for reference (compact format, no newlines) - all_workspaces_json=$(echo "$all_workspaces" | grep -v '^$' | jq -R . | jq -s -c . || echo "[]") - echo "all_workspaces=$all_workspaces_json" >> "$GITHUB_OUTPUT" - - - name: Display detection results - run: | - echo "## Workspace Change Detection Results" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - - if [[ "${{ steps.detect.outputs.has_changes }}" == "true" ]]; then - echo "### Changed Workspaces" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo '${{ steps.detect.outputs.changed_workspaces_json }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" - else - echo "No workspace changes detected." >> "$GITHUB_STEP_SUMMARY" - fi - - echo "" >> "$GITHUB_STEP_SUMMARY" - echo "### All Workspaces" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo '${{ steps.detect.outputs.all_workspaces }}' | jq -r '.[] | "- `" + . + "`"' >> "$GITHUB_STEP_SUMMARY" - - # Example job showing how to use the detection results - example-conditional-job: - needs: detect-changes - if: needs.detect-changes.outputs.has_changes == 'true' - runs-on: ubuntu-latest - strategy: - matrix: - workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-mise - - name: Process changed workspace - run: | - echo "Processing workspace: ${{ matrix.workspace }}" - # Add workspace-specific commands here - # For example: - # cd "${{ matrix.workspace }}" && deno check . - # cd "${{ matrix.workspace }}" && deno test - # Or use pnpm filters: - # pnpm --filter "${{ matrix.workspace }}" test - - # Test @fedify/cli when packages/cli changes - test-cli-init: - needs: detect-changes - if: contains(needs.detect-changes.outputs.changed_workspaces, 'packages/cli') - runs-on: ubuntu-latest - services: - rabbitmq: - image: rabbitmq - env: - RABBITMQ_DEFAULT_USER: guest - RABBITMQ_DEFAULT_PASS: guest - ports: - - 5672:5672 - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - env: - AMQP_URL: amqp://guest:guest@localhost:5672 - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres - REDIS_URL: redis://localhost:6379 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-mise - - name: Run deno task test-init for @fedify/cli - run: | - cd packages/cli - deno task test-init From 0d93c512dd2cf64e49ac316229e5b0928efe9bf4 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 15:56:35 +0900 Subject: [PATCH 4/8] Integrate detect-workspace to test, publish --- .github/workflows/main.yaml | 134 ++++++++++++++++++++++++++++++++---- 1 file changed, 120 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bea8cd8d..f9fa07b3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,6 +32,8 @@ jobs: uses: ./.github/actions/detect-workspace-changes test: + needs: detect-changes + if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest permissions: contents: read @@ -74,15 +76,41 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: ./.github/actions/setup-mise - - run: mise run test:deno -- --coverage=.cov --junit-path=.test-report.xml + - name: Run Deno tests for changed packages + run: | + # Get base ref for deno test filter + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + base_ref="" + fi + fi + + # Run deno test with filter for changed files + if [[ -n "$base_ref" ]]; then + changed_files=$(git diff --name-only "${base_ref}" HEAD | grep '\.ts$' || true) + if [[ -n "$changed_files" ]]; then + mise run codegen + deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel --coverage=.cov --junit-path=.test-report.xml $changed_files + else + echo "No TypeScript files changed, skipping Deno tests" + fi + else + mise run test:deno -- --coverage=.cov --junit-path=.test-report.xml + fi env: RUST_BACKTRACE: ${{ runner.debug }} LOG: ${{ runner.debug && 'always' || '' }} - uses: dorny/test-reporter@v2 if: success() || failure() with: - name: "Test Results (${{ matrix.os }})" + name: "Test Results (Deno)" path: .test-report.xml reporter: jest-junit continue-on-error: true @@ -100,6 +128,8 @@ jobs: continue-on-error: true test-node: + needs: detect-changes + if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest services: rabbitmq: @@ -137,10 +167,31 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: ./.github/actions/setup-mise - - run: mise run test:node + - name: Run Node.js tests for changed packages + run: | + # Get base ref for pnpm filter + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + base_ref="" + fi + fi + + if [[ -n "$base_ref" ]]; then + pnpm run --recursive --filter="...[${base_ref}]" --filter='!{docs}' test + else + mise run test:node + fi test-bun: + needs: detect-changes + if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest services: rabbitmq: @@ -178,8 +229,27 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: ./.github/actions/setup-mise - - run: mise run test:bun + - name: Run Bun tests for changed packages + run: | + # Get base ref for pnpm filter + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + base_ref="" + fi + fi + + if [[ -n "$base_ref" ]]; then + pnpm run --recursive --filter="...[${base_ref}]" --filter='!{docs}' test:bun + else + mise run test:bun + fi test-cfworkers: runs-on: ubuntu-latest @@ -236,11 +306,32 @@ jobs: deno task test-init lint: + needs: detect-changes + if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: ./.github/actions/setup-mise - - run: mise run check + - name: Run lint/check for changed packages + run: | + # Get base ref for pnpm filter + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + base_ref="${{ github.event.pull_request.base.sha }}" + else + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + base_ref="" + fi + fi + + if [[ -n "$base_ref" ]]; then + pnpm run --recursive --filter="...[${base_ref}]" check + else + mise run check + fi release-test: runs-on: ubuntu-latest @@ -318,8 +409,8 @@ jobs: # =========================================================================== build-cli: - if: github.event_name == 'push' - needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version] + if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -336,16 +427,31 @@ jobs: packages/cli/fedify-cli-*.zip build-packages: - if: github.event_name == 'push' - needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version] + if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: ./.github/actions/setup-mise - uses: ./.github/actions/determine-version - run: sudo npm install -g npm@latest && npm --version - - run: | - pnpm pack --recursive --filter='!./examples/**' + - name: Pack changed packages + run: | + # Get base ref for pnpm filter + if git rev-parse HEAD~1 >/dev/null 2>&1; then + base_ref="HEAD~1" + else + base_ref="" + fi + + if [[ -n "$base_ref" && "${{ needs.detect-changes.outputs.has_changes }}" == "true" ]]; then + pnpm pack --recursive --filter="...[${base_ref}]" --filter='!./examples/**' + else + pnpm pack --recursive --filter='!./examples/**' + fi + # Remove private packages for pkg in fedify-*.tgz; do if tar -xOzf "$pkg" package/package.json | jq -e '.private == true' > /dev/null 2>&1; then @@ -354,7 +460,7 @@ jobs: fi done if [[ "$GITHUB_REF_TYPE" != tag ]]; then - rm fedify-cli-*.tgz + rm fedify-cli-*.tgz 2>/dev/null || true fi - uses: actions/upload-artifact@v4 with: @@ -362,8 +468,8 @@ jobs: path: fedify-*.tgz publish-jsr: - if: github.event_name == 'push' - needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version] + if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest permissions: id-token: write From 48f4c6f86282416f3b0bd80c472beea9ad09f6d2 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 16:17:30 +0900 Subject: [PATCH 5/8] Integrate matrix to main.yaml --- .github/workflows/main.yaml | 166 +++++++++++++----------------------- 1 file changed, 57 insertions(+), 109 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f9fa07b3..3f9aed00 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -40,6 +40,10 @@ jobs: issues: read checks: write pull-requests: write + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} services: rabbitmq: image: rabbitmq @@ -76,33 +80,15 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: ./.github/actions/setup-mise - - name: Run Deno tests for changed packages + - name: Run Deno tests for ${{ matrix.workspace }} + working-directory: ${{ matrix.workspace }} run: | - # Get base ref for deno test filter - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - base_ref="${{ github.event.pull_request.base.sha }}" + if [[ -f "deno.json" ]] || [[ -f "deno.jsonc" ]]; then + mise run codegen || true + deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel --coverage=.cov --junit-path=.test-report.xml else - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - base_ref="" - fi - fi - - # Run deno test with filter for changed files - if [[ -n "$base_ref" ]]; then - changed_files=$(git diff --name-only "${base_ref}" HEAD | grep '\.ts$' || true) - if [[ -n "$changed_files" ]]; then - mise run codegen - deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel --coverage=.cov --junit-path=.test-report.xml $changed_files - else - echo "No TypeScript files changed, skipping Deno tests" - fi - else - mise run test:deno -- --coverage=.cov --junit-path=.test-report.xml + echo "No deno.json found in ${{ matrix.workspace }}, skipping" fi env: RUST_BACKTRACE: ${{ runner.debug }} @@ -110,27 +96,32 @@ jobs: - uses: dorny/test-reporter@v2 if: success() || failure() with: - name: "Test Results (Deno)" - path: .test-report.xml + name: "Test Results (Deno) - ${{ matrix.workspace }}" + path: ${{ matrix.workspace }}/.test-report.xml reporter: jest-junit continue-on-error: true - if: '!cancelled()' uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - files: .test-report.xml - - run: deno coverage --lcov .cov > .cov.lcov + files: ${{ matrix.workspace }}/.test-report.xml + continue-on-error: true + - run: deno coverage --lcov ${{ matrix.workspace }}/.cov > ${{ matrix.workspace }}/.cov.lcov continue-on-error: true - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: .cov.lcov + files: ${{ matrix.workspace }}/.cov.lcov continue-on-error: true test-node: needs: detect-changes if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} services: rabbitmq: image: rabbitmq @@ -167,32 +158,19 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: ./.github/actions/setup-mise - - name: Run Node.js tests for changed packages - run: | - # Get base ref for pnpm filter - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - base_ref="${{ github.event.pull_request.base.sha }}" - else - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - base_ref="" - fi - fi - - if [[ -n "$base_ref" ]]; then - pnpm run --recursive --filter="...[${base_ref}]" --filter='!{docs}' test - else - mise run test:node - fi + - name: Run Node.js tests for ${{ matrix.workspace }} + run: pnpm --filter "${{ matrix.workspace }}" test + continue-on-error: true test-bun: needs: detect-changes if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} services: rabbitmq: image: rabbitmq @@ -229,29 +207,14 @@ jobs: REDIS_URL: redis://localhost:6379 steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: ./.github/actions/setup-mise - - name: Run Bun tests for changed packages - run: | - # Get base ref for pnpm filter - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - base_ref="${{ github.event.pull_request.base.sha }}" - else - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - base_ref="" - fi - fi - - if [[ -n "$base_ref" ]]; then - pnpm run --recursive --filter="...[${base_ref}]" --filter='!{docs}' test:bun - else - mise run test:bun - fi + - name: Run Bun tests for ${{ matrix.workspace }} + run: pnpm --filter "${{ matrix.workspace }}" test:bun + continue-on-error: true test-cfworkers: + needs: detect-changes + if: contains(needs.detect-changes.outputs.changed_workspaces, 'packages/fedify') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -309,29 +272,16 @@ jobs: needs: detect-changes if: needs.detect-changes.outputs.has_changes == 'true' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + workspace: ${{ fromJson(needs.detect-changes.outputs.changed_workspaces_json) }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: ./.github/actions/setup-mise - - name: Run lint/check for changed packages - run: | - # Get base ref for pnpm filter - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - base_ref="${{ github.event.pull_request.base.sha }}" - else - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - base_ref="" - fi - fi - - if [[ -n "$base_ref" ]]; then - pnpm run --recursive --filter="...[${base_ref}]" check - else - mise run check - fi + - name: Run lint/check for ${{ matrix.workspace }} + run: pnpm --filter "${{ matrix.workspace }}" check + continue-on-error: true release-test: runs-on: ubuntu-latest @@ -352,8 +302,8 @@ jobs: # =========================================================================== build-cli-pr: - if: github.event_name == 'pull_request' - needs: [release-test] + if: github.event_name == 'pull_request' && contains(needs.detect-changes.outputs.changed_workspaces, 'packages/cli') + needs: [release-test, detect-changes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -369,8 +319,8 @@ jobs: packages/cli/fedify-cli-*.zip build-docs-pr: - if: github.event_name == 'pull_request' - needs: [release-test] + if: github.event_name == 'pull_request' && contains(needs.detect-changes.outputs.changed_workspaces, 'docs') + needs: [release-test, detect-changes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -409,7 +359,10 @@ jobs: # =========================================================================== build-cli: - if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + if: | + github.event_name == 'push' && + (success() || + (needs.test.result == 'skipped' && needs.test-node.result == 'skipped' && needs.test-bun.result == 'skipped' && needs.lint.result == 'skipped')) needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest steps: @@ -427,7 +380,10 @@ jobs: packages/cli/fedify-cli-*.zip build-packages: - if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + if: | + github.event_name == 'push' && + (success() || + (needs.test.result == 'skipped' && needs.test-node.result == 'skipped' && needs.test-bun.result == 'skipped' && needs.lint.result == 'skipped')) needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest steps: @@ -437,20 +393,9 @@ jobs: - uses: ./.github/actions/setup-mise - uses: ./.github/actions/determine-version - run: sudo npm install -g npm@latest && npm --version - - name: Pack changed packages + - name: Pack all packages run: | - # Get base ref for pnpm filter - if git rev-parse HEAD~1 >/dev/null 2>&1; then - base_ref="HEAD~1" - else - base_ref="" - fi - - if [[ -n "$base_ref" && "${{ needs.detect-changes.outputs.has_changes }}" == "true" ]]; then - pnpm pack --recursive --filter="...[${base_ref}]" --filter='!./examples/**' - else - pnpm pack --recursive --filter='!./examples/**' - fi + pnpm pack --recursive --filter='!./examples/**' # Remove private packages for pkg in fedify-*.tgz; do @@ -468,7 +413,10 @@ jobs: path: fedify-*.tgz publish-jsr: - if: github.event_name == 'push' && (success() || needs.detect-changes.outputs.has_changes == 'false') + if: | + github.event_name == 'push' && + (success() || + (needs.test.result == 'skipped' && needs.test-node.result == 'skipped' && needs.test-bun.result == 'skipped' && needs.lint.result == 'skipped')) needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version, detect-changes] runs-on: ubuntu-latest permissions: From 664d4efb29d527c5c4a11b878dae5acc6616ba08 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 16:32:51 +0900 Subject: [PATCH 6/8] deno test filter change --- .github/workflows/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f9aed00..394786f9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -86,7 +86,9 @@ jobs: run: | if [[ -f "deno.json" ]] || [[ -f "deno.jsonc" ]]; then mise run codegen || true - deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel --coverage=.cov --junit-path=.test-report.xml + # Run all tests in this workspace directory (not parent workspaces) + deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel \ + --coverage=.cov --junit-path=.test-report.xml else echo "No deno.json found in ${{ matrix.workspace }}, skipping" fi From edf81b40bf0d686241be066071f1877fdfd74ef6 Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 16:42:05 +0900 Subject: [PATCH 7/8] Add explicit test file setting --- packages/amqp/deno.json | 11 ++++++++++- packages/cfworkers/deno.json | 11 ++++++++++- packages/denokv/deno.json | 11 ++++++++++- packages/elysia/deno.json | 11 ++++++++++- packages/express/deno.json | 11 ++++++++++- packages/fastify/deno.json | 11 ++++++++++- packages/fedify/deno.json | 7 +++++++ packages/fixture/deno.json | 9 ++++++++- packages/fresh/deno.json | 11 ++++++++++- packages/h3/deno.json | 11 ++++++++++- packages/hono/deno.json | 11 ++++++++++- packages/koa/deno.json | 11 ++++++++++- packages/lint/deno.json | 11 ++++++++++- packages/postgres/deno.json | 11 ++++++++++- packages/redis/deno.json | 11 ++++++++++- packages/relay/deno.json | 11 ++++++++++- packages/sqlite/deno.json | 7 +++++++ packages/sveltekit/deno.json | 11 ++++++++++- packages/testing/deno.json | 11 ++++++++++- packages/vocab-runtime/deno.json | 11 ++++++++++- packages/vocab-tools/deno.json | 11 ++++++++++- packages/vocab/deno.json | 8 ++++++++ packages/webfinger/deno.json | 7 +++++++ 23 files changed, 217 insertions(+), 19 deletions(-) diff --git a/packages/amqp/deno.json b/packages/amqp/deno.json index ab7c3c15..a79670b8 100644 --- a/packages/amqp/deno.json +++ b/packages/amqp/deno.json @@ -17,7 +17,9 @@ "pnpm-lock.yaml" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "build": "pnpm build", @@ -42,5 +44,12 @@ "test:bun" ] } + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/cfworkers/deno.json b/packages/cfworkers/deno.json index 4ada84af..241f4f3a 100644 --- a/packages/cfworkers/deno.json +++ b/packages/cfworkers/deno.json @@ -14,9 +14,18 @@ "test" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/denokv/deno.json b/packages/denokv/deno.json index 7f78f8c3..cbfd6bd8 100644 --- a/packages/denokv/deno.json +++ b/packages/denokv/deno.json @@ -14,10 +14,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-net --allow-env" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/elysia/deno.json b/packages/elysia/deno.json index 7e796b7f..94ebb284 100644 --- a/packages/elysia/deno.json +++ b/packages/elysia/deno.json @@ -10,9 +10,18 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/express/deno.json b/packages/express/deno.json index 0795c20c..254e69f3 100644 --- a/packages/express/deno.json +++ b/packages/express/deno.json @@ -13,9 +13,18 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check *.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/fastify/deno.json b/packages/fastify/deno.json index da694741..c22869aa 100644 --- a/packages/fastify/deno.json +++ b/packages/fastify/deno.json @@ -14,10 +14,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-all" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/fedify/deno.json b/packages/fedify/deno.json index 49cc8c9f..6858c9d9 100644 --- a/packages/fedify/deno.json +++ b/packages/fedify/deno.json @@ -123,5 +123,12 @@ "test:cfworkers" ] } + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/fixture/deno.json b/packages/fixture/deno.json index 6d73f088..528e814d 100644 --- a/packages/fixture/deno.json +++ b/packages/fixture/deno.json @@ -12,5 +12,12 @@ "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" }, - "publish": false + "publish": false, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] + } } diff --git a/packages/fresh/deno.json b/packages/fresh/deno.json index d8b40226..848bfd66 100644 --- a/packages/fresh/deno.json +++ b/packages/fresh/deno.json @@ -14,9 +14,18 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/h3/deno.json b/packages/h3/deno.json index c002581d..5a1f183d 100644 --- a/packages/h3/deno.json +++ b/packages/h3/deno.json @@ -10,9 +10,18 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/hono/deno.json b/packages/hono/deno.json index 95962e2c..7ddc9aa9 100644 --- a/packages/hono/deno.json +++ b/packages/hono/deno.json @@ -13,10 +13,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-net --allow-env" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/koa/deno.json b/packages/koa/deno.json index e454b2f3..d17bdfcc 100644 --- a/packages/koa/deno.json +++ b/packages/koa/deno.json @@ -13,9 +13,18 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/lint/deno.json b/packages/lint/deno.json index c36b21d4..0d803910 100644 --- a/packages/lint/deno.json +++ b/packages/lint/deno.json @@ -10,9 +10,18 @@ "estree": "npm:@types/estree@^1.0.8" }, "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "test": "deno test --allow-env" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/postgres/deno.json b/packages/postgres/deno.json index 08cc9d35..eba3f154 100644 --- a/packages/postgres/deno.json +++ b/packages/postgres/deno.json @@ -12,10 +12,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-net --allow-env" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/redis/deno.json b/packages/redis/deno.json index 9063255c..f0e88260 100644 --- a/packages/redis/deno.json +++ b/packages/redis/deno.json @@ -13,10 +13,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-net --allow-env --doc --no-check=leaks" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/relay/deno.json b/packages/relay/deno.json index fe602ecb..46834551 100644 --- a/packages/relay/deno.json +++ b/packages/relay/deno.json @@ -13,7 +13,9 @@ "node_modules/" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "codegen": "deno task -f @fedify/vocab compile", @@ -39,5 +41,12 @@ "exclude": [ "src/init/templates/**" ] + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/sqlite/deno.json b/packages/sqlite/deno.json index 83f9a6f3..86c174d1 100644 --- a/packages/sqlite/deno.json +++ b/packages/sqlite/deno.json @@ -23,5 +23,12 @@ "tasks": { "check": "deno fmt --check && deno lint && deno check", "test": "deno test --allow-net --allow-env --doc --no-check=leaks" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/sveltekit/deno.json b/packages/sveltekit/deno.json index 1b4482c9..2625cda2 100644 --- a/packages/sveltekit/deno.json +++ b/packages/sveltekit/deno.json @@ -14,10 +14,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test --allow-net --allow-env" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/testing/deno.json b/packages/testing/deno.json index dc5fcb7e..1061bbaf 100644 --- a/packages/testing/deno.json +++ b/packages/testing/deno.json @@ -12,7 +12,9 @@ "pnpm-lock.yaml" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "build": "pnpm build", @@ -37,5 +39,12 @@ "test:bun" ] } + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/vocab-runtime/deno.json b/packages/vocab-runtime/deno.json index 4219d9db..0b4e5753 100644 --- a/packages/vocab-runtime/deno.json +++ b/packages/vocab-runtime/deno.json @@ -24,10 +24,19 @@ "node_modules" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/vocab-tools/deno.json b/packages/vocab-tools/deno.json index 81bdce2e..df4a129f 100644 --- a/packages/vocab-tools/deno.json +++ b/packages/vocab-tools/deno.json @@ -20,10 +20,19 @@ "src/schema.yaml" ], "publish": { - "exclude": ["**/*.test.ts"] + "exclude": [ + "**/*.test.ts" + ] }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test -A" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } diff --git a/packages/vocab/deno.json b/packages/vocab/deno.json index a7afbdb3..014e3381 100644 --- a/packages/vocab/deno.json +++ b/packages/vocab/deno.json @@ -27,5 +27,13 @@ "check": "deno fmt --check && deno lint && deno check src/*.ts", "compile": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno fmt src/vocab.ts && deno cache src/vocab.ts && deno check src/vocab.ts", "test": "deno test --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } + diff --git a/packages/webfinger/deno.json b/packages/webfinger/deno.json index e49acf7d..0e82cb9d 100644 --- a/packages/webfinger/deno.json +++ b/packages/webfinger/deno.json @@ -22,5 +22,12 @@ "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts", "test": "deno test" + }, + "test": { + "include": [ + "./**/*_test.ts", + "./**/*_test.tsx", + "./**/*.test.ts" + ] } } From f576274fc9e643062e717bad77d53f5ed8cb4fdb Mon Sep 17 00:00:00 2001 From: "Kim, Hyeonseo" Date: Fri, 16 Jan 2026 17:22:56 +0900 Subject: [PATCH 8/8] Check test file existence --- .github/workflows/main.yaml | 13 ++++++++++++- packages/cfworkers/deno.json | 7 ------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 394786f9..18f3fcdc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -87,8 +87,19 @@ jobs: if [[ -f "deno.json" ]] || [[ -f "deno.jsonc" ]]; then mise run codegen || true # Run all tests in this workspace directory (not parent workspaces) + # Exit successfully even if no tests are found deno test --check --doc --allow-all --unstable-kv --trace-leaks --parallel \ - --coverage=.cov --junit-path=.test-report.xml + --coverage=.cov --junit-path=.test-report.xml || { + exit_code=$? + if [[ $exit_code -eq 1 ]]; then + # Exit code 1 might mean no tests found, check if test files exist + if ! find . -name "*_test.ts" -o -name "*_test.tsx" -o -name "*.test.ts" 2>/dev/null | grep -q .; then + echo "No test files found in ${{ matrix.workspace }}, skipping" + exit 0 + fi + fi + exit $exit_code + } else echo "No deno.json found in ${{ matrix.workspace }}, skipping" fi diff --git a/packages/cfworkers/deno.json b/packages/cfworkers/deno.json index 241f4f3a..78394e0a 100644 --- a/packages/cfworkers/deno.json +++ b/packages/cfworkers/deno.json @@ -20,12 +20,5 @@ }, "tasks": { "check": "deno fmt --check && deno lint && deno check src/*.ts" - }, - "test": { - "include": [ - "./**/*_test.ts", - "./**/*_test.tsx", - "./**/*.test.ts" - ] } }