Skip to content

Commit 98a0822

Browse files
authored
Replace Travis with Github Actions (mbleigh#1021)
1 parent 4e7600c commit 98a0822

File tree

4 files changed

+100
-58
lines changed

4 files changed

+100
-58
lines changed

.github/workflows/spec.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: spec
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
continue-on-error: ${{ matrix.ruby == 'head' }}
9+
env:
10+
DB: ${{ matrix.db }}
11+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
12+
strategy:
13+
matrix:
14+
ruby:
15+
- 2.3
16+
- 2.4
17+
- 2.5
18+
- 2.6
19+
- 2.7
20+
- 3.0
21+
- head
22+
gemfile:
23+
- gemfiles/activerecord_5.0.gemfile
24+
- gemfiles/activerecord_5.2.gemfile
25+
- gemfiles/activerecord_5.1.gemfile
26+
- gemfiles/activerecord_6.0.gemfile
27+
- gemfiles/activerecord_6.1.gemfile
28+
db:
29+
- mysql
30+
- postgresql
31+
- sqlite3
32+
exclude:
33+
# Unfortunately, the mysql2 gem encounters a segfault in the ruby 2.3 environment:
34+
- ruby: 2.3
35+
db: mysql
36+
# Exclude ActiveRecord 6.x for Ruby < 2.5
37+
- ruby: 2.3
38+
gemfile: gemfiles/activerecord_6.0.gemfile
39+
- ruby: 2.3
40+
gemfile: gemfiles/activerecord_6.1.gemfile
41+
- ruby: 2.4
42+
gemfile: gemfiles/activerecord_6.0.gemfile
43+
- ruby: 2.4
44+
gemfile: gemfiles/activerecord_6.1.gemfile
45+
# Exclude ActiveRecord 5.x for Ruby >= 3.0
46+
- ruby: 3.0
47+
gemfile: gemfiles/activerecord_5.0.gemfile
48+
- ruby: 3.0
49+
gemfile: gemfiles/activerecord_5.1.gemfile
50+
- ruby: 3.0
51+
gemfile: gemfiles/activerecord_5.2.gemfile
52+
- ruby: head
53+
gemfile: gemfiles/activerecord_5.0.gemfile
54+
- ruby: head
55+
gemfile: gemfiles/activerecord_5.1.gemfile
56+
- ruby: head
57+
gemfile: gemfiles/activerecord_5.2.gemfile
58+
59+
services:
60+
postgres:
61+
image: postgres:10
62+
env:
63+
POSTGRES_USER: postgres
64+
POSTGRES_DB: acts_as_taggable_on
65+
POSTGRES_PASSWORD: postgres
66+
ports: ['5432:5432']
67+
options: >-
68+
--health-cmd pg_isready
69+
--health-interval 10s
70+
--health-timeout 5s
71+
--health-retries 5
72+
mysql:
73+
image: mysql:8
74+
env:
75+
MYSQL_ALLOW_EMPTY_PASSWORD: true
76+
ports: ['3306:3306']
77+
options: >-
78+
--health-cmd "mysqladmin ping"
79+
--health-interval 10s
80+
--health-timeout 5s
81+
--health-retries 5
82+
steps:
83+
- uses: actions/checkout@v2
84+
- name: Set up Ruby
85+
uses: ruby/setup-ruby@v1
86+
with:
87+
ruby-version: ${{ matrix.ruby }}
88+
bundler-cache: true
89+
- name: Create MySQL test database with utf8mb4 charset
90+
if: ${{ matrix.db == 'mysql' }}
91+
run: |
92+
mysql -uroot --host=127.0.0.1 -e "CREATE DATABASE acts_as_taggable_on CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
93+
- name: Build and test with Rake
94+
run: |
95+
bundle exec rake

.travis.yml

-49
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
[![Join the chat at https://gitter.im/mbleigh/acts-as-taggable-on](https://badges.gitter.im/mbleigh/acts-as-taggable-on.svg)](https://gitter.im/mbleigh/acts-as-taggable-on?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3434
[![Gem Version](https://badge.fury.io/rb/acts-as-taggable-on.svg)](http://badge.fury.io/rb/acts-as-taggable-on)
35-
[![Build Status](https://secure.travis-ci.com/mbleigh/acts-as-taggable-on.svg)](http://travis-ci.com/mbleigh/acts-as-taggable-on)
35+
[![Build Status](https://github.com/mbleigh/acts-as-taggable-on/workflows/spec/badge.svg)](https://github.com/mbleigh/acts-as-taggable-on/actions)
3636
[![Code Climate](https://codeclimate.com/github/mbleigh/acts-as-taggable-on.svg)](https://codeclimate.com/github/mbleigh/acts-as-taggable-on)
3737
[![Inline docs](http://inch-ci.org/github/mbleigh/acts-as-taggable-on.svg)](http://inch-ci.org/github/mbleigh/acts-as-taggable-on)
3838
[![Security](https://hakiri.io/github/mbleigh/acts-as-taggable-on/master.svg)](https://hakiri.io/github/mbleigh/acts-as-taggable-on/master)

spec/internal/config/database.yml.sample

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ sqlite3:
44

55
mysql:
66
adapter: mysql2
7-
host: localhost
7+
host: 127.0.0.1
88
username: root
99
password:
1010
database: acts_as_taggable_on
11-
charset: utf8
11+
encoding: utf8
1212

1313
postgresql:
14-
adapter: postgresql
15-
hostname: localhost
16-
username: postgres
17-
password:
18-
database: acts_as_taggable_on
19-
encoding: utf8
14+
# Needs to be given as a URL to force connection via TCP
15+
url: postgresql://postgres:[email protected]:5432/acts_as_taggable_on?encoding=utf8

0 commit comments

Comments
 (0)