This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 317
69 lines (60 loc) · 1.56 KB
/
ci.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
name: Tests
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: test_app_production
POSTGRES_USER: test_app
POSTGRES_PASSWORD: password
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test_app_production
MYSQL_USER: test_app
MYSQL_PASSWORD: password
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: yarn
- name: Install dependencies
run: |
npm install -g npm
sudo apt-get -yqq install libsqlite3-dev libpq-dev libmysqlclient-dev
gem install rails
# Clean up git repo so the new rails template doesn't conflict
- name: Remove git repo
run: |
rm -rf .git
- name: Run tests
env:
TEST_APP_DATABASE_PASSWORD: password
run: |
rake