Skip to content

Upstream generators #12

Upstream generators

Upstream generators #12

Workflow file for this run

name: Test Generators
on:
push:
branches:
- master
paths:
- 'lib/generators/**'
- '.github/workflows/generators.yml'
- 'lib/inertia_rails/generators/**'
pull_request:
paths:
- 'lib/generators/**'
- '.github/workflows/generators.yml'
- 'lib/inertia_rails/generators/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
framework: [react, vue, svelte4, svelte]
typescript: [true, false]
tailwind: [true, false]
ruby: ['3.3']
node: ['22']
inertia_version: ['1.2.0', '1.3.0-beta.2', '2.0.0-beta.2']
exclude:
# 1.2.0 does not support typescript
- typescript: true
inertia_version: '1.2.0'
# 1.2.0 doesn't support Svelte 5
- framework: svelte
inertia_version: '1.2.0'
name: ${{ matrix.framework }} (TS:${{ matrix.typescript }}, TW:${{ matrix.tailwind }}, Inertia:${{ matrix.inertia_version }})
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
tmp/bundle_cache
tmp/npm_cache
~/.npm
key: ${{ runner.os }}-deps-${{ matrix.framework }}-${{ matrix.inertia_version }}-${{ hashFiles('**/Gemfile.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.framework }}-
${{ runner.os }}-deps-
- name: Install Rails
run: gem install rails
- name: Run test script
run: |
ts_flag=${{ matrix.typescript && '--typescript' || '--no-typescript' }}
tw_flag=${{ matrix.tailwind && '--tailwind' || '--no-tailwind' }}
bin/generate_scaffold_example --framework=${{ matrix.framework }} --inertia-version=${{ matrix.inertia_version }} $ts_flag $tw_flag
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-output-${{ matrix.framework }}-ts${{ matrix.typescript }}-tw${{ matrix.tailwind }}-v${{ matrix.inertia_version }}
path: |
tmp/scaffold_example/log
tmp/scaffold_example/tmp/screenshots
if-no-files-found: ignore