-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (57 loc) · 1.57 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
name: "Landscapes CI"
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install required apt packages
run: |
sudo apt-get -y install libpq-dev
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup database
run: bin/rails db:setup
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: Install Node dependencies
run: |
yarn --frozen-lockfile
- name: Precompile assets
run: SECRET_KEY_BASE="0" bin/rails assets:precompile
- name: Rails tests
run: bin/rails test
- name: System tests (Chrome)
run: SYSTEM_TEST_BROWSER=headless_chrome bin/rails test:system
- name: System tests (Firefox)
run: SYSTEM_TEST_BROWSER=headless_firefox bin/rails test:system