-
Notifications
You must be signed in to change notification settings - Fork 227
69 lines (58 loc) · 1.73 KB
/
rubyonrails.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
# 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 CI"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
merge_group:
branches: [ master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 3
- name: Rubocop
run: bundle exec rubocop
- name: Erblint
run: bundle exec erblint --lint-all
test:
runs-on: ubuntu-latest
env:
RESTFUL_HOST: localhost
RESTFUL_PORT: 3000
RESTFUL_KEY: test_key
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 3
- name: Set up Autolab
run: |
cp config/database.github.yml config/database.yml
cp config/school.yml.template config/school.yml
cp config/autogradeConfig.rb.template config/autogradeConfig.rb
cp .env.template .env
mkdir tmp/
- name: Set up database
run: |
sudo /etc/init.d/mysql start
RAILS_ENV=development bundle exec rails db:create
./bin/initialize_secrets.sh
RAILS_ENV=test bundle exec rails autolab:setup_test_env
- name: Run tests
run: bundle exec rails spec