-
Notifications
You must be signed in to change notification settings - Fork 24
68 lines (65 loc) · 2.2 KB
/
build.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
# 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 download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Build - 3.3.0
on:
pull_request:
branches:
- master
- develop
- '[0-9].[0-9]'
- '[0-9].[0-9].[0-9]'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [3.3.0]
env:
DATABASE_URL: mysql2://root@127.0.0.1:3800/myapp_test
steps:
- uses: actions/checkout@v2
- name: Start MySQL
uses: cbaudouinjr/mysql-action@v1.9
with:
host port: 3800
container port: 3800
mysql timezone: America/New_York
mysql version: '5.7'
mysql database: 'myapp_test'
- name: Update and install packages
run: |
sudo apt-get update
sudo apt-get install -y libtool
sudo apt-get install -y libyaml-dev
sudo apt-get install -y build-essential
sudo apt-get install -y libxslt-dev
sudo apt-get install -y libxml2-dev
sudo apt-get install -y default-libmysqlclient-dev
sudo apt-get install -y default-mysql-client
- name: Set up Ruby
env:
ImageOS: ubuntu18
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
# This version tag came with the Ruby build script built by GitHub. @v1 does not work.
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install gems
run: |
gem install pkg-config
bundle config build.nokogiri --use-system-libraries
bundle install
- name: Setup database
env:
RAILS_ENV: test
run: |
bin/rails db:migrate
- name: Run tests
run: bundle exec rake