Skip to content

Commit c616633

Browse files
committed
1 parent f586e19 commit c616633

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

.github/workflows/cronjob.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: cronjob
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
sqlite3:
9+
runs-on: ubuntu-20.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ruby:
14+
- 3.0.0
15+
- 2.7.2
16+
- 2.6.6
17+
env:
18+
DB: sqlite3
19+
RAILS: master
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby }}
26+
- name: Install dependencies
27+
run: bundle install
28+
- name: Run tests
29+
run: bundle exec rspec
30+
31+
mysql:
32+
runs-on: ubuntu-20.04
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
ruby:
37+
- 3.0.0
38+
- 2.7.2
39+
- 2.6.6
40+
env:
41+
DB: mysql
42+
RAILS: master
43+
MYSQL_USERNAME: root
44+
MYSQL_PASSWORD: root
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Set up Ruby
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: ${{ matrix.ruby }}
51+
- name: Startup MySQL
52+
run: |
53+
sudo systemctl start mysql.service
54+
- name: Setup databases
55+
run: |
56+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
57+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
58+
- name: Install dependencies
59+
run: bundle install
60+
- name: Run tests
61+
run: bundle exec rspec
62+
63+
postgres:
64+
runs-on: ubuntu-20.04
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
ruby:
69+
- 3.0.0
70+
- 2.7.2
71+
- 2.6.6
72+
env:
73+
DB: postgres
74+
RAILS: master
75+
DATABASE_USERNAME: postgres
76+
DATABASE_PASSWORD: postgres
77+
DATABASE_HOST: 127.0.0.1
78+
services:
79+
postgres:
80+
image: postgres
81+
ports:
82+
- 5432:5432
83+
env:
84+
POSTGRES_PASSWORD: postgres
85+
POSTGRES_HOST_AUTH_METHOD: trust
86+
# Set health checks to wait until postgres has started
87+
options: >-
88+
--health-cmd pg_isready
89+
--health-interval 10s
90+
--health-timeout 5s
91+
--health-retries 5
92+
93+
steps:
94+
- uses: actions/checkout@v2
95+
- name: Set up Ruby
96+
uses: ruby/setup-ruby@v1
97+
with:
98+
ruby-version: ${{ matrix.ruby }}
99+
- name: Setup databases
100+
run: |
101+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
102+
- name: Install dependencies
103+
run: bundle install
104+
- name: Run tests
105+
run: bundle exec rspec

0 commit comments

Comments
 (0)