-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (162 loc) · 5.91 KB
/
ruby-on-rails--restful-api.yml
File metadata and controls
166 lines (162 loc) · 5.91 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: Ruby on Rails - RESTful API
on:
push:
branches:
- master
paths:
- .github/actions/setup-ruby-on-rails/action.yml
- .github/workflows/restful-api.yml
- .ruby-version
- ruby-on-rails/restful-api/.ruby-version
- ruby-on-rails/restful-api/Gemfile
- ruby-on-rails/restful-api/Gemfile.lock
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/.rubocop.yml
- ruby-on-rails/restful-api/.rubocop_todo.yml
- ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/**/*.rb
- ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rake
- ruby-on-rails/restful-api/**/*.yml
pull_request:
paths:
- .github/actions/setup-ruby-on-rails/action.yml
- .github/workflows/restful-api.yml
- .ruby-version
- ruby-on-rails/restful-api/.ruby-version
- ruby-on-rails/restful-api/Gemfile
- ruby-on-rails/restful-api/Gemfile.lock
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/.rubocop.yml
- ruby-on-rails/restful-api/.rubocop_todo.yml
- ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/**/*.rb
- ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rake
- ruby-on-rails/restful-api/**/*.yml
permissions:
contents: read
pull-requests: read
jobs:
change-detection:
runs-on: ubuntu-latest
outputs:
ruby-changes: ${{ steps.change-detection.outputs.ruby }}
rubocop-changes: ${{ steps.change-detection.outputs.rubocop}}
steep-changes: ${{ steps.change-detection.outputs.steep}}
steps:
- uses: actions/checkout@v6
- name: Change Detection
uses: dorny/paths-filter@v4
id: change-detection
with:
filters: |
ruby:
- .github/actions/setup-ruby-on-rails/action.yml
- .github/workflows/restful-api.yml
- .ruby-version
- ruby-on-rails/restful-api/.ruby-version
- ruby-on-rails/restful-api/Gemfile
- ruby-on-rails/restful-api/Gemfile.lock
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/**/*.rb
- ruby-on-rails/restful-api/**/*.rake
- ruby-on-rails/restful-api/**/*.yml
rubocop:
- .github/actions/setup-ruby-on-rails/action.yml
- .github/workflows/restful-api.yml
- .ruby-version
- ruby-on-rails/restful-api/.ruby-version
- ruby-on-rails/restful-api/Gemfile
- ruby-on-rails/restful-api/Gemfile.lock
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/.rubocop.yml
- ruby-on-rails/restful-api/.rubocop_todo.yml
- ruby-on-rails/restful-api/**/*.rb
- ruby-on-rails/restful-api/**/*.rake
steep:
- .github/actions/setup-ruby-on-rails/action.yml
- .github/workflows/restful-api.yml
- .ruby-version
- ruby-on-rails/restful-api/.ruby-version
- ruby-on-rails/restful-api/Gemfile
- ruby-on-rails/restful-api/Gemfile.lock
- ruby-on-rails/restful-api/Rakefile
- ruby-on-rails/restful-api/Steepfile
- ruby-on-rails/restful-api/**/*.rb
- ruby-on-rails/restful-api/**/*.rbs
- ruby-on-rails/restful-api/**/*.rake
rspec:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
services:
mysql:
image: mysql:9.6.0
env:
DB_USERNAME: '${{ secrets.DB_USERNAME }}'
MYSQL_ROOT_PASSWORD: '${{ secrets.DB_ROOT_PASSWORD }}'
DB_HOST: '${{ secrets.DB_HOST }}'
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
if: needs.change-detection.outputs.ruby-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-on-rails
with:
working-directory: ./ruby-on-rails/restful-api
job-name: rspec
- name: RSpec
working-directory: ./ruby-on-rails/restful-api
run: bundle exec rspec
brakeman:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
if: needs.change-detection.outputs.ruby-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-on-rails
with:
working-directory: ./ruby-on-rails/restful-api
job-name: brakeman
- name: Brakeman
working-directory: ./ruby-on-rails/restful-api
run: bundle exec brakeman --no-pager
rubocop:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
if: needs.change-detection.outputs.rubocop-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-on-rails
with:
working-directory: ./ruby-on-rails/restful-api
job-name: rubocop
- name: RuboCop
working-directory: ./ruby-on-rails/restful-api
run: bundle exec rubocop
steep:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
if: needs.change-detection.outputs.steep-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-ruby-on-rails
with:
working-directory: ./ruby-on-rails/restful-api
job-name: steep
- name: Steep
working-directory: ./ruby-on-rails/restful-api
run: |
bundle exec rbs-inline --output sig/generated/ .
bundle exec steep check