-
-
Notifications
You must be signed in to change notification settings - Fork 55
93 lines (75 loc) · 2.63 KB
/
CI.yml
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
# 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: "Generate sample app and run tests"
on: [push]
jobs:
test_html:
name: 🧪 Run HTML Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Install the latest Rails gem
run: gem install rails -v "7.2.1"
- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
- name: Install Brakeman
run: gem install brakeman
- name: Create fresh Rails app and run generator
run: |
rails new test-app --skip-action-mailbox --skip-action-text --skip-active-storage
cp .rubocop.yml test-app/.rubocop.yml
cd test-app
bundle add authentication-zero --path ..
bin/rails generate authentication
bundle install
bin/rails db:migrate
- name: Rubocop
run: cd test-app && rubocop
- name: Brakeman
run: cd test-app && brakeman
- name: Tests
run: |
cd test-app
bin/rails test
test_api:
name: 🧪 Run API Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Install the latest Rails gem
run: gem install rails -v "7.2.1"
- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
- name: Install Brakeman
run: gem install brakeman
- name: Create fresh Rails app and run generator
run: |
rails new test-app --skip-action-mailbox --skip-action-text --skip-active-storage
cp .rubocop.yml test-app/.rubocop.yml
cd test-app
bundle add authentication-zero --path ..
bin/rails generate authentication --api
bundle install
bin/rails db:migrate
- name: Rubocop
run: cd test-app && rubocop
- name: Brakeman
run: cd test-app && brakeman
- name: Tests
run: cd test-app && bin/rails test