-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 1.72 KB
/
Copy pathci.yml
File metadata and controls
73 lines (60 loc) · 1.72 KB
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
70
71
72
73
name: CI
on:
pull_request:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: quote_editor_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
chrome:
image: selenium/standalone-chrome:latest
ports:
- 4444:4444
options: >-
--add-host=host.docker.internal:host-gateway
--shm-size=2g
env:
RAILS_ENV: test
DATABASE_URL_TEST: postgres://postgres:postgres@127.0.0.1:5432/quote_editor_test
SELENIUM_REMOTE_URL: http://127.0.0.1:4444/wd/hub
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
- name: Install JS deps
run: yarn install --frozen-lockfile
- name: Check Postgres is reachable
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
PGPASSWORD=postgres psql -h 127.0.0.1 -U postgres -d quote_editor_test -c "select 1;"
- name: Show DB env vars
run: |
echo "RAILS_ENV=$RAILS_ENV"
echo "DATABASE_URL=$DATABASE_URL"
echo "DATABASE_URL_TEST=$DATABASE_URL_TEST"
- name: Prepare DB
run: bin/rails db:prepare
- name: Run system tests
run: bin/rails test:system