Skip to content

Commit 8170a37

Browse files
authored
Merge pull request #158 from skryukov/upstream-generators
Upstream generators
2 parents e11e8c5 + eac9c73 commit 8170a37

File tree

202 files changed

+8770
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+8770
-216
lines changed

.github/workflows/generators.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test Generators
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'lib/generators/**'
9+
- '.github/workflows/generators.yml'
10+
- 'lib/inertia_rails/generators/**'
11+
pull_request:
12+
paths:
13+
- 'lib/generators/**'
14+
- '.github/workflows/generators.yml'
15+
- 'lib/inertia_rails/generators/**'
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
framework: [react, vue, svelte, svelte4]
24+
typescript: [true, false]
25+
tailwind: [true, false]
26+
ruby: ['3.3']
27+
node: ['22']
28+
inertia_version: ['1.2.0', 'next', 'beta']
29+
exclude:
30+
# 1.2.0 does not support typescript
31+
- typescript: true
32+
inertia_version: '1.2.0'
33+
# 1.2.0 doesn't support Svelte 5
34+
- framework: svelte
35+
inertia_version: '1.2.0'
36+
37+
name: ${{ matrix.framework }} (TS:${{ matrix.typescript }}, TW:${{ matrix.tailwind }}, Inertia:${{ matrix.inertia_version }})
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Set up Ruby
43+
uses: ruby/setup-ruby@v1
44+
with:
45+
ruby-version: ${{ matrix.ruby }}
46+
bundler-cache: true
47+
48+
- name: Set up Node
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: ${{ matrix.node }}
52+
53+
- name: Cache dependencies
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
tmp/bundle_cache
58+
tmp/npm_cache
59+
~/.npm
60+
key: ${{ runner.os }}-deps-${{ matrix.framework }}-${{ matrix.inertia_version }}-${{ hashFiles('**/Gemfile.lock') }}-${{ github.sha }}
61+
restore-keys: |
62+
${{ runner.os }}-deps-${{ matrix.framework }}-
63+
${{ runner.os }}-deps-
64+
65+
- name: Install Rails
66+
run: gem install rails
67+
68+
- name: Run test script
69+
run: |
70+
ts_flag=${{ matrix.typescript && '--typescript' || '--no-typescript' }}
71+
tw_flag=${{ matrix.tailwind && '--tailwind' || '--no-tailwind' }}
72+
bin/generate_scaffold_example --framework=${{ matrix.framework }} --inertia-version=${{ matrix.inertia_version }} $ts_flag $tw_flag
73+
74+
- name: Upload test artifacts
75+
if: failure()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: test-output-${{ matrix.framework }}-ts${{ matrix.typescript }}-tw${{ matrix.tailwind }}-v${{ matrix.inertia_version }}
79+
path: |
80+
tmp/scaffold_example/log
81+
tmp/scaffold_example/tmp/screenshots
82+
if-no-files-found: ignore

.github/workflows/push.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ on:
1515
- '**.md'
1616

1717
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
name: Linter
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: "3.3"
27+
bundler: latest
28+
bundler-cache: true
29+
- name: Run RuboCop
30+
run: bundle exec rubocop
31+
1832
test:
1933
strategy:
2034
fail-fast: false
@@ -31,6 +45,11 @@ jobs:
3145
- name: Setup System
3246
run: sudo apt-get install libsqlite3-dev
3347

48+
- name: Set up Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 22.x
52+
3453
- name: Set up Ruby
3554
uses: ruby/setup-ruby@v1
3655
with:
@@ -40,6 +59,6 @@ jobs:
4059
RAILS_VERSION: ${{ matrix.rails }}
4160

4261
- name: Run tests
43-
run: bundle exec rake
62+
run: bundle exec rspec
4463
env:
4564
RAILS_VERSION: ${{ matrix.rails }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/pkg/
77
/spec/reports/
88
/tmp/
9+
/.cache/
910
/Gemfile.lock
1011

1112
/spec/dummy/db/*.sqlite3

.rubocop.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
AllCops:
4+
TargetRubyVersion: 3.0
5+
NewCops: enable
6+
SuggestExtensions: false
7+
8+
Metrics:
9+
Enabled: false
10+
11+
Style/Documentation:
12+
Enabled: false
13+
14+
Style/TrailingCommaInHashLiteral:
15+
EnforcedStyleForMultiline: consistent_comma

0 commit comments

Comments
 (0)