Skip to content
69 changes: 69 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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

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
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generator tests
name: Generator tests # TODO needs to be duplicated for RoR Pro

on:
push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Main test
name: Integration Tests

on:
push:
Expand All @@ -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:
Expand Down
49 changes: 11 additions & 38 deletions .github/workflows/lint-js-and-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
12 changes: 10 additions & 2 deletions .github/workflows/package-js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Playwright E2E Tests
on:
push:
branches: [master]
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch:

jobs:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/pro-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/pro-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading