Merge pull request #260 from skryukov/fix-errors-with-partials #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, svelte, svelte4] | |
typescript: [true, false] | |
tailwind: [true, false] | |
ruby: ['3.3'] | |
node: ['22'] | |
inertia_version: ['latest'] | |
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: Run generator tests | |
run: bundle exec rspec --tag type:generator | |
- 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 |