diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000000..00196ca979 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,74 @@ +name: Lint JS and Ruby + +on: + push: + branches: + - 'master' + paths: + - '.github/workflows/**' + pull_request: + paths: + - '.github/workflows/**' + workflow_dispatch: + +jobs: + actionlint: + env: + BUNDLE_FROZEN: true + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + # No need for history in lint job + fetch-depth: 1 + persist-credentials: false + # We only download and run Actionlint if there is any difference in GitHub Action workflows + # https://github.com/rhysd/actionlint/blob/main/docs/usage.md#on-github-actions + - name: Check GitHub Action changes + id: check-workflows + run: | + BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}" + if [ -n "$BASE_SHA" ]; then + git fetch origin "$BASE_SHA" 2>/dev/null || true + fi + + # For PRs, diff against base; for pushes, use before commit + if [ -n "${{ github.event.pull_request.base.sha }}" ]; then + DIFF_BASE="${{ github.event.pull_request.base.sha }}" + else + DIFF_BASE="${{ github.event.before }}" + fi + + # Handle initial commits where before SHA is all zeros + if [[ "$DIFF_BASE" =~ ^0+$ ]]; then + DIFF_BASE="origin/master" + fi + + if git diff --name-only "$DIFF_BASE" ${{ github.sha }} 2>/dev/null | grep -q '^.github/workflows'; then + echo "changed=true" >> "$GITHUB_OUTPUT" + response=$(curl -sf https://api.github.com/repos/rhysd/actionlint/releases/latest) + if [ $? -eq 0 ]; then + actionlint_version=$(echo "$response" | jq -r .tag_name) + if [ -z "$actionlint_version" ]; then + echo "Failed to parse Actionlint version" + exit 1 + fi + echo "actionlint_version=\"$actionlint_version\"" >> "$GITHUB_OUTPUT" + fi + fi + - name: Setup Actionlint + if: steps.check-workflows.outputs.changed == 'true' + uses: actions/cache@v4 + id: cache-actionlint + with: + path: ./actionlint + key: ${{ runner.os }}-actionlint-${{ steps.check-workflows.outputs.actionlint_version }} + - name: Download Actionlint + if: steps.check-workflows.outputs.changed == 'true' && steps.cache-actionlint.outputs.cache-hit != 'true' + run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + - name: Lint GitHub Actions + if: steps.check-workflows.outputs.changed == 'true' + run: | + echo "::add-matcher::.github/actionlint-matcher.json" + SHELLCHECK_OPTS="-S warning" ./actionlint -color + shell: bash diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6a639a2b6b..3846462ea7 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,4 +1,4 @@ -name: Generator tests +name: Generator tests # TODO needs to be duplicated for RoR Pro on: push: diff --git a/.github/workflows/rspec-package-specs.yml b/.github/workflows/gem-tests.yml similarity index 91% rename from .github/workflows/rspec-package-specs.yml rename to .github/workflows/gem-tests.yml index af91bb3ba9..62773d5bf2 100644 --- a/.github/workflows/rspec-package-specs.yml +++ b/.github/workflows/gem-tests.yml @@ -7,15 +7,21 @@ on: paths-ignore: - '**.md' - 'docs/**' - - 'packages/react-on-rails/src/**' - - 'node_package/src/**' + - 'packages/**' + - 'react_on_rails_pro/**' pull_request: paths-ignore: - '**.md' - 'docs/**' - - 'packages/react-on-rails/src/**' - - 'node_package/src/**' + - 'packages/**' + - 'react_on_rails_pro/**' workflow_dispatch: + inputs: + force_run: + description: 'Force run all jobs (bypass detect-changes)' + required: false + type: boolean + default: false jobs: detect-changes: @@ -40,8 +46,8 @@ jobs: - name: Detect relevant changes id: detect run: | - # If full-ci label is present, run everything - if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + # If force_run is true OR full-ci label is present, run everything + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then echo "run_lint=true" >> "$GITHUB_OUTPUT" echo "run_js_tests=true" >> "$GITHUB_OUTPUT" echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/main.yml b/.github/workflows/integration-tests.yml similarity index 89% rename from .github/workflows/main.yml rename to .github/workflows/integration-tests.yml index 8983bbe9fd..03231da3ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/integration-tests.yml @@ -1,4 +1,4 @@ -name: Main test +name: Integration Tests on: push: @@ -7,10 +7,12 @@ on: paths-ignore: - '**.md' - 'docs/**' + - 'react_on_rails_pro/**' pull_request: paths-ignore: - '**.md' - 'docs/**' + - 'react_on_rails_pro/**' workflow_dispatch: inputs: force_run: @@ -50,11 +52,10 @@ jobs: echo "run_dummy_tests=true" >> "$GITHUB_OUTPUT" echo "run_generators=true" >> "$GITHUB_OUTPUT" echo "docs_only=false" >> "$GITHUB_OUTPUT" - exit 0 - fi - - BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" + else + BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" script/ci-changes-detector "$BASE_REF" + fi shell: bash build-dummy-app-webpack-test-bundles: @@ -64,20 +65,14 @@ jobs: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: matrix: + ruby-version: ['3.4'] + node-version: ['22'] + dependency-level: ['latest'] include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - node-version: '22' - dependency-level: 'latest' - # Master and workflow_dispatch: Minimum supported versions (full coverage) - - ruby-version: '3.2' - node-version: '20' - dependency-level: 'minimum' - exclude: # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} + node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -152,17 +147,15 @@ jobs: if: | github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: - fail-fast: false matrix: + ruby-version: ['3.4'] + node-version: ['22'] + dependency-level: ['latest'] include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - node-version: '22' - dependency-level: 'latest' - # Master and workflow_dispatch: Minimum supported versions (full coverage) - - ruby-version: '3.2' - node-version: '20' - dependency-level: 'minimum' + # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) + - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} + node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} + dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} exclude: # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} diff --git a/.github/workflows/lint-js-and-ruby.yml b/.github/workflows/lint-js-and-ruby.yml index f96ead86e9..7d0a7329c6 100644 --- a/.github/workflows/lint-js-and-ruby.yml +++ b/.github/workflows/lint-js-and-ruby.yml @@ -7,11 +7,19 @@ on: paths-ignore: - '**.md' - 'docs/**' + - 'react_on_rails_pro/**' pull_request: paths-ignore: - '**.md' - 'docs/**' + - 'react_on_rails_pro/**' workflow_dispatch: + inputs: + force_run: + description: 'Force run all jobs (bypass detect-changes)' + required: false + type: boolean + default: false jobs: detect-changes: @@ -35,8 +43,8 @@ jobs: - name: Detect relevant changes id: detect run: | - # If full-ci label is present, run everything - if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + # If force_run is true OR full-ci label is present, run everything + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then echo "run_lint=true" >> "$GITHUB_OUTPUT" echo "run_js_tests=true" >> "$GITHUB_OUTPUT" echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" @@ -71,10 +79,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -144,35 +149,3 @@ jobs: run: yarn run publint --strict packages/react-on-rails/react-on-rails.tgz # We only download and run Actionlint if there is any difference in GitHub Action workflows # https://github.com/rhysd/actionlint/blob/main/docs/usage.md#on-github-actions - - name: Check GitHub Action changes - id: check-workflows - run: | - git fetch origin ${{ github.event.pull_request.base.sha }} - if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q '^.github/workflows'; then - echo "changed=true" >> "$GITHUB_OUTPUT" - response=$(curl -sf https://api.github.com/repos/rhysd/actionlint/releases/latest) - if [ $? -eq 0 ]; then - actionlint_version=$(echo "$response" | jq -r .tag_name) - if [ -z "$actionlint_version" ]; then - echo "Failed to parse Actionlint version" - exit 1 - fi - echo "actionlint_version=\"$actionlint_version\"" >> "$GITHUB_OUTPUT" - fi - fi - - name: Setup Actionlint - if: steps.check-workflows.outputs.changed == 'true' - uses: actions/cache@v4 - id: cache-actionlint - with: - path: ./actionlint - key: ${{ runner.os }}-actionlint-${{ steps.check-workflows.outputs.actionlint_version }} - - name: Download Actionlint - if: steps.check-workflows.outputs.changed == 'true' && steps.cache-actionlint.outputs.cache-hit != 'true' - run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) - - name: Lint GitHub Actions - if: steps.check-workflows.outputs.changed == 'true' - run: | - echo "::add-matcher::.github/actionlint-matcher.json" - SHELLCHECK_OPTS="-S warning" ./actionlint -color - shell: bash diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 0b404fd1b1..24bb2d0830 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -9,13 +9,21 @@ on: - 'docs/**' - 'lib/**' - 'spec/react_on_rails/**' + - 'react_on_rails_pro/**' pull_request: paths-ignore: - '**.md' - 'docs/**' - 'lib/**' - 'spec/react_on_rails/**' + - 'react_on_rails_pro/**' workflow_dispatch: + inputs: + force_run: + description: 'Force run all jobs (bypass detect-changes)' + required: false + type: boolean + default: false jobs: detect-changes: @@ -40,8 +48,8 @@ jobs: - name: Detect relevant changes id: detect run: | - # If full-ci label is present, run everything - if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + # If force_run is true OR full-ci label is present, run everything + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then echo "run_lint=true" >> "$GITHUB_OUTPUT" echo "run_js_tests=true" >> "$GITHUB_OUTPUT" echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ddab0abce0..1616f6cde0 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -3,6 +3,9 @@ name: Playwright E2E Tests on: push: branches: [master] + paths-ignore: + - '**.md' + - 'docs/**' workflow_dispatch: jobs: diff --git a/.github/workflows/pro-integration-tests.yml b/.github/workflows/pro-integration-tests.yml index 05f58fff1a..1c5cde1a4a 100644 --- a/.github/workflows/pro-integration-tests.yml +++ b/.github/workflows/pro-integration-tests.yml @@ -4,7 +4,19 @@ on: push: branches: - 'master' + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' pull_request: + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' workflow_dispatch: inputs: force_run: @@ -71,10 +83,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information @@ -161,10 +170,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information @@ -352,10 +358,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information diff --git a/.github/workflows/pro-lint.yml b/.github/workflows/pro-lint.yml index 4b75353562..907ba092cd 100644 --- a/.github/workflows/pro-lint.yml +++ b/.github/workflows/pro-lint.yml @@ -4,7 +4,19 @@ on: push: branches: - 'master' + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' pull_request: + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' workflow_dispatch: inputs: force_run: @@ -70,10 +82,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information diff --git a/.github/workflows/pro-package-tests.yml b/.github/workflows/pro-test-package-and-gem.yml similarity index 95% rename from .github/workflows/pro-package-tests.yml rename to .github/workflows/pro-test-package-and-gem.yml index 99afb186d3..386d26c2cf 100644 --- a/.github/workflows/pro-package-tests.yml +++ b/.github/workflows/pro-test-package-and-gem.yml @@ -4,7 +4,19 @@ on: push: branches: - 'master' + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' pull_request: + paths-ignore: + - '**.md' + - 'docs/**' + - 'lib/**' + - 'spec/**' + - 'packages/react_on_rails/**' workflow_dispatch: inputs: force_run: @@ -71,10 +83,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information @@ -166,10 +175,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - # TODO: Re-enable cache when Node.js 22 V8 bug is fixed - # Disable cache for Node 22 due to V8 bug in 22.21.0 - # Track: https://github.com/nodejs/node/issues/56010 - cache: '' + cache: yarn cache-dependency-path: 'react_on_rails_pro/**/yarn.lock' - name: Print system information diff --git a/script/ci-changes-detector b/script/ci-changes-detector index 16224aa652..c9cfafbd81 100755 --- a/script/ci-changes-detector +++ b/script/ci-changes-detector @@ -53,14 +53,16 @@ fi # Initialize flags DOCS_ONLY=true -RUBY_CHANGED=false -JS_CHANGED=false -GENERATORS_CHANGED=false -WORKFLOWS_CHANGED=false LINT_CONFIG_CHANGED=false -SPEC_DUMMY_CHANGED=false +PRO_LINT_CONFIG_CHANGED=false +RUBY_CHANGED=false RSPEC_CHANGED=false -PRO_CHANGED=false +SPEC_DUMMY_CHANGED=false +JS_CHANGED=false +GENERATORS_CHANGED=false # needs to be duplicated to pro +PRO_RUBY_CHANGED=false +PRO_RSPEC_CHANGED=false +PRO_JS_CHANGED=false PRO_DUMMY_CHANGED=false # Analyze each changed file @@ -72,69 +74,69 @@ while IFS= read -r file; do ;; # Ruby source code - lib/*.rb|lib/**/*.rb) + lib/*.rb|lib/**/*.rb|Gemfile|Gemfile.lock|rakelib/run_rspec.rake|rakelib/node_package.rake|rakelib/dummy_apps.rake) DOCS_ONLY=false RUBY_CHANGED=true ;; - # Ruby specs (except dummy app) - spec/react_on_rails/*|spec/react_on_rails/**/*) + # Ruby gem-specific specs + spec/react_on_rails/*|spec/react_on_rails/**/*|.github/workflows/gem-tests.yml) DOCS_ONLY=false - RUBY_CHANGED=true RSPEC_CHANGED=true ;; # Generators - lib/generators/*|lib/generators/**/*|rakelib/example_type.rb|rakelib/example_config.yml|rakelib/examples.rake) + lib/generators/*|lib/generators/**/*|rakelib/example_type.rb|rakelib/examples_config.yml|rakelib/shakapacker_examples.rake|.github/workflows/examples.yml) DOCS_ONLY=false GENERATORS_CHANGED=true ;; # JavaScript/TypeScript source - packages/react-on-rails/src/*|packages/react-on-rails/src/**/*|node_package/src/*|node_package/src/**/*) + package.json|yarn.lock|packages/react-on-rails/src/*|packages/react-on-rails/src/**/*|.github/workflows/package-js-tests.yml) DOCS_ONLY=false JS_CHANGED=true ;; # Dummy app - spec/dummy/*) + spec/dummy/*|spec/dummy/**/*|.github/workflows/integration-tests.yml) DOCS_ONLY=false SPEC_DUMMY_CHANGED=true ;; - # React on Rails Pro package / dummy app - react_on_rails_pro/spec/dummy/*) + # React on Rails Pro source code + react_on_rails_pro/lib/*|react_on_rails_pro/lib/**/*) DOCS_ONLY=false - PRO_CHANGED=true - PRO_DUMMY_CHANGED=true + PRO_RUBY_CHANGED=true ;; - react_on_rails_pro/*|react_on_rails_pro/**/*) + + # JavaScript/TypeScript Pro source + packages/react-on-rails-pro/src/*|packages/react-on-rails-pro/src/**/*) DOCS_ONLY=false - PRO_CHANGED=true + PRO_JS_CHANGED=true ;; - # GitHub workflows - .github/workflows/*) + # Ruby Pro gem-specific specs + react_on_rails_pro/spec/react_on_rails/*|react_on_rails_pro/spec/react_on_rails/**/*|.github/workflows/pro-gem-tests.yml) DOCS_ONLY=false - WORKFLOWS_CHANGED=true + PRO_RSPEC_CHANGED=true ;; - # Lint/format configuration - .rubocop.yml|.eslintrc*|.prettierrc*|tsconfig.json|.editorconfig) + # React on Rails Pro package / dummy app + react_on_rails_pro/spec/dummy/*|react_on_rails_pro/spec/dummy/**/*|.github/workflows/pro-integration-tests.yml) DOCS_ONLY=false - LINT_CONFIG_CHANGED=true + PRO_DUMMY_CHANGED=true ;; - # Gemfile, package.json, lockfiles - Gemfile|Gemfile.lock|package.json|yarn.lock|spec/dummy/Gemfile|spec/dummy/Gemfile.lock|spec/dummy/package.json|spec/dummy/yarn.lock) + # Lint/format configuration + .rubocop.yml|.eslintrc*|.prettierrc*|tsconfig.json|.editorconfig|.github/workflows/lint-js-and-ruby.yml) DOCS_ONLY=false - RUBY_CHANGED=true - JS_CHANGED=true + LINT_CONFIG_CHANGED=true ;; - # Anything else is considered a code change - *) + # Lint/format configuration + react_on_rails_pro/.rubocop.yml|react_on_rails_pro/.eslintrc*|react_on_rails_pro/.prettierrc*|react_on_rails_pro/tsconfig.json|react_on_rails_pro/.editorconfig|.github/workflows/pro-lint.yml) DOCS_ONLY=false + PRO_LINT_CONFIG_CHANGED=true ;; esac done <<< "$CHANGED_FILES" @@ -154,15 +156,19 @@ if [ "$DOCS_ONLY" = true ]; then exit 0 fi +# TODO: need to add node-renderer tests echo "Changed file categories:" [ "$RUBY_CHANGED" = true ] && echo -e "${YELLOW} • Ruby source code${NC}" [ "$JS_CHANGED" = true ] && echo -e "${YELLOW} • JavaScript/TypeScript code${NC}" -[ "$GENERATORS_CHANGED" = true ] && echo -e "${YELLOW} • Generators${NC}" [ "$RSPEC_CHANGED" = true ] && echo -e "${YELLOW} • RSpec tests${NC}" [ "$SPEC_DUMMY_CHANGED" = true ] && echo -e "${YELLOW} • Dummy app${NC}" -[ "$PRO_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro${NC}" -[ "$WORKFLOWS_CHANGED" = true ] && echo -e "${YELLOW} • GitHub workflows${NC}" +[ "$GENERATORS_CHANGED" = true ] && echo -e "${YELLOW} • Generators${NC}" +[ "$PRO_JS_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro JavaScript/TypeScript${NC}" +[ "$PRO_RSPEC_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro RSpec tests${NC}" +[ "$PRO_RUBY_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro Ruby source code${NC}" +[ "$PRO_DUMMY_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro Dummy app${NC}" [ "$LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • Lint/format configuration${NC}" +[ "$PRO_LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro lint/format configuration${NC}" echo "" echo "Recommended CI jobs:" @@ -175,8 +181,9 @@ RUN_DUMMY_TESTS=false RUN_GENERATORS=false RUN_PRO_LINT=false RUN_PRO_TESTS=false +RUN_PRO_DUMMY_TESTS=false -if [ "$LINT_CONFIG_CHANGED" = true ] || [ "$RUBY_CHANGED" = true ] || [ "$JS_CHANGED" = true ] || [ "$WORKFLOWS_CHANGED" = true ]; then +if [ "$LINT_CONFIG_CHANGED" = true ] || [ "$RUBY_CHANGED" = true ] || [ "$JS_CHANGED" = true ] || [ "$SPEC_DUMMY_CHANGED" = true ]; then RUN_LINT=true fi @@ -196,22 +203,26 @@ if [ "$GENERATORS_CHANGED" = true ]; then RUN_GENERATORS=true fi -if [ "$PRO_CHANGED" = true ]; then +if [ "$PRO_LINT_CONFIG_CHANGED" = true ] || [ "$PRO_RUBY_CHANGED" = true ] || [ "$PRO_JS_CHANGED" = true ] || [ "$PRO_DUMMY_CHANGED" = true ]; then RUN_PRO_LINT=true - RUN_PRO_TESTS=true fi -if [ "$PRO_DUMMY_CHANGED" = true ]; then +if [ "$PRO_RUBY_CHANGED" = true ] || [ "$PRO_RSPEC_CHANGED" = true ] || [ "$PRO_JS_CHANGED" = true ]; then RUN_PRO_TESTS=true fi +if [ "$PRO_DUMMY_CHANGED" = true ] || [ "$PRO_RUBY_CHANGED" = true ] || [ "$PRO_JS_CHANGED" = true ]; then + RUN_PRO_DUMMY_TESTS=true +fi + [ "$RUN_LINT" = true ] && echo " ✓ Lint (Ruby + JS)" [ "$RUN_RUBY_TESTS" = true ] && echo " ✓ RSpec gem tests" [ "$RUN_JS_TESTS" = true ] && echo " ✓ JS unit tests" [ "$RUN_DUMMY_TESTS" = true ] && echo " ✓ Dummy app integration tests" [ "$RUN_GENERATORS" = true ] && echo " ✓ Generator tests" -[ "$RUN_PRO_LINT" = true ] && echo " ✓ React on Rails Pro lint" -[ "$RUN_PRO_TESTS" = true ] && echo " ✓ React on Rails Pro tests" +[ "$RUN_PRO_LINT" = true ] && echo " ✓ React on Rails Pro Lint (Ruby + JS)" +[ "$RUN_PRO_TESTS" = true ] && echo " ✓ React on Rails Pro RSpec unit tests (Ruby + JS)" +[ "$RUN_PRO_DUMMY_TESTS" = true ] && echo " ✓ React on Rails Pro Dummy app integration tests" # Export as GitHub Actions outputs if running in CI if [ -n "${GITHUB_OUTPUT:-}" ]; then @@ -224,6 +235,7 @@ if [ -n "${GITHUB_OUTPUT:-}" ]; then echo "run_generators=$RUN_GENERATORS" echo "run_pro_lint=$RUN_PRO_LINT" echo "run_pro_tests=$RUN_PRO_TESTS" + echo "run_pro_dummy_tests=$RUN_PRO_DUMMY_TESTS" } >> "$GITHUB_OUTPUT" fi @@ -238,7 +250,8 @@ if [ "${CI_JSON_OUTPUT:-}" = "1" ]; then "run_dummy_tests": $RUN_DUMMY_TESTS, "run_generators": $RUN_GENERATORS, "run_pro_lint": $RUN_PRO_LINT, - "run_pro_tests": $RUN_PRO_TESTS + "run_pro_tests": $RUN_PRO_TESTS, + "run_pro_dummy_tests": $RUN_PRO_DUMMY_TESTS } EOF fi