forked from CircuitVerse/CircuitVerse
-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (65 loc) · 1.78 KB
/
percy.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
name: "Percy Visual Tests"
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
percy-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
redis:
image: redis:alpine
ports: ["6379:6379"]
options: --entrypoint redis-server
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
- name: Install Percy CLI
run: npm install --save-dev @percy/cli
- name: Install Gems
run: bundle install
- name: Prepare DB
run: |
bin/rails db:schema:load
bin/rails data:migrate
- name: Configure keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
- name: Configure keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
- name: Build assets (if needed)
run: yarn run build
- name: Run tests with Percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: npx percy exec -- bundle exec rspec