-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (80 loc) · 2.44 KB
/
run-tests.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
70
71
72
73
74
75
76
77
78
79
80
# 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 install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "CI"
on:
push:
branches:
[
"master",
"DM-5074-ipm-homepage-updates",
"ci-migration",
"ci-migration-cv",
"ci-migration-en",
"ci-migration-pd",
"ci-migration-bj",
]
pull_request:
branches: ["master", "DM-5074-ipm-homepage-updates"]
jobs:
build:
name: rspec
runs-on: ubuntu-latest
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
REDIS_URL: redis://localhost:6379/0
HOSTNAME: "http://localhost:3200"
GOOGLE_TEST_API_KEY: ${{ secrets.GOOGLE_TEST_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_TEST_API_KEY }}
services:
postgres:
image: postgres:13-alpine
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
redis:
image: redis
ports: ["6379:6379"]
options: --entrypoint redis-server
env:
REDIS_HOST: redis_test
REDIS_PORT: 6379
REDIS_DB_ID: 0
selenium:
image: selenium/standalone-chrome:latest
ports: ["4444:4444"]
steps:
- uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install PostgreSQL
run: sudo apt-get -yqq install libpq-dev
- name: Install ImageMagick
run: sudo apt-get install imagemagick
- name: Precompile assets
run: RAILS_ENV=test bundle exec rails assets:precompile
- name: Run bundle install
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Setup Database
run: bin/rails db:drop db:create db:schema:load
- name: Build and test with rspec
run: bundle exec rspec