-
Notifications
You must be signed in to change notification settings - Fork 42
140 lines (137 loc) · 4.48 KB
/
Copy pathmain.yml
File metadata and controls
140 lines (137 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
max-parallel: 1
matrix:
ruby:
- '3.3'
- '3.4'
- '4.0'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
env:
TEST_HTTP_URL: ${{ secrets.TEST_HTTP_URL }}
TEST_PG_URL: ${{ secrets.TEST_PG_URL }}
TEST_MYSQL_URL: ${{ secrets.TEST_MYSQL_URL }}
TEST_REDIS_URL: ${{ secrets.TEST_REDIS_URL }}
ENABLE_EXTERNAL_TESTS: ${{ secrets.ENABLE_EXTERNAL_TESTS }}
run: bundle exec rake
linter:
runs-on: ubuntu-latest
name: Code Style
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: 3.4
bundler-cache: true
- name: Run Linter
run: bundle exec rubocop
docs:
runs-on: ubuntu-latest
name: Docs
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: 3.4
bundler-cache: true
- name: Run YARD
run: bundle exec yardoc --fail-on-warning
cli:
runs-on: ubuntu-latest
name: CLI
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: 3.4
bundler-cache: true
- name: Build the gem
run: gem build -o rage-local.gem && gem install rage-local.gem --no-document
- name: Create a project
run: rage new my_app
- name: Bundle
working-directory: ./my_app
run: bundle install
- name: Start the server
working-directory: ./my_app
run: bundle exec rage s&
- name: Test the default route
run: curl --fail http://localhost:3000
- name: Run the routes task
working-directory: ./my_app
run: bundle exec rage routes
- name: Add a Rake task
working-directory: ./my_app
run: printf "desc \"Prints From Rake\"\nnamespace :hello do\ntask :print do\nputs('Hello!')\nend\nend" > lib/tasks/hello.rake
- name: Check available Rake tasks
working-directory: ./my_app
run: bundle exec rake --tasks | grep "rake hello:print"
- name: Run the Rake task
working-directory: ./my_app
run: test "$(bundle exec rake hello:print)" = "Hello!"
cli-d:
runs-on: ubuntu-latest
name: CLI DB
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: 3.4
bundler-cache: true
- name: Build the gem
run: gem build -o rage-local.gem && gem install rage-local.gem --no-document
- name: Create a project
run: rage new my_app -d sqlite3
- name: Bundle install
working-directory: ./my_app
run: bundle
- name: List available tasks
working-directory: ./my_app
shell: 'script -q -e -c "bash {0}"'
run: bundle exec rage --tasks
- name: Create a database
working-directory: ./my_app
run: bundle exec rage db:create
- name: Create a model
working-directory: ./my_app
run: bundle exec rage g model User
- name: Migrate
working-directory: ./my_app
run: bundle exec rage db:migrate
- name: Bundle
working-directory: ./my_app
run: bundle install
- name: Start the server
working-directory: ./my_app
run: bundle exec rage s&
- name: Test the default route
run: curl --fail http://localhost:3000
- name: Add a Rake task
working-directory: ./my_app
run: printf "desc \"Prints From Rake\"\nnamespace :hello do\ntask :print do\nputs('Hello!')\nend\nend" > lib/tasks/hello.rake
- name: Check available Rake tasks
working-directory: ./my_app
run: bundle exec rake --tasks | grep "rake hello:print"
- name: Run the Rake task
working-directory: ./my_app
run: test "$(bundle exec rake hello:print)" = "Hello!"