-
Notifications
You must be signed in to change notification settings - Fork 13
62 lines (49 loc) · 1.74 KB
/
rspec_requests.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
name: RSpec Response Tests
on: pull_request
jobs:
rspec-response:
name: RSpec Request Tests
runs-on: ubuntu-22.04
env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
RAILS_ENV: test
steps:
- name: 'Checkout the repo'
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: 'Set Ruby and Bundler Versions'
run: |
echo "RUBY_VERSION=3.3.1" >> $GITHUB_ENV
echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
- name: 'Install Ruby and gems'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: 'setup node for node-sass'
uses: actions/setup-node@v4
with:
node-version: 20
- name: 'Install MySQL Packages'
run: |
sudo apt-get update
sudo apt-get install -y mysql-client libmysqlclient-dev
- name: 'Start MySQL'
run: sudo systemctl start mysql
- name: 'Setup Test DB'
run: |
mysql -u root -e 'CREATE DATABASE IF NOT EXISTS dashv2_test'
mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost'
mysql -u root -e 'GRANT ALL ON dashv2_test.* TO travis@localhost'
mysql -u root -e 'set global log_bin_trust_function_creators=1'
bin/rails db:migrate:reset RAILS_ENV=test
- name: 'Compile Assets'
run: |
yarn install
RAILS_ENV=test bundle exec rails assets:precompile
- name: 'Compile webpacker assets'
run: RAILS_ENV=test bundle exec rails webpacker:compile
- name: 'Run RSpec Request Tests'
run: bin/bundle exec rspec --force-color --format RSpec::Github::Formatter --format progress --tag ~skip spec/requests