-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (73 loc) · 2.33 KB
/
main.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: Rails
on: push
jobs:
verify:
name: Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: rails_github_actions
POSTGRES_DB: rails_github_actions_test
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
env:
HAPPI_TEAM_ID: 4
RAILS_ENV: test
PGHOST: localhost
POSTGRES_DB: rails_github_actions_test
POSTGRES_USER: rails_github_actions
POSTGRES_PASSWORD: postgres
GOOGLE_RECAPTCHA_KEY: ${{ secrets.GOOGLE_RECAPTCHA_KEY }}
GOOGLE_RECAPTCHA_SECRET: ${{ secrets.GOOGLE_RECAPTCHA_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
STRIPE_TEST_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}
STRIPE_TEST_WEBHOOKS_SECRET: ${{ secrets.STRIPE_TEST_WEBHOOKS_SECRET }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
POSTMARK_WEBHOOKS_PASSWORD: "testpassword"
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.14.2
- name: Set timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/London"
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -yqq install libpq-dev build-essential libcurl4-openssl-dev
gem install bundler
bundle install --jobs 4 --retry 3
yarn install
- name: Setup test database
run: |
cp config/database.ci.yml config/database.yml
bundle exec rake db:create db:schema:load
- name: Precompile assets
run: bundle exec rails assets:precompile
- name: Run tests
run: bundle exec rspec
# - name: Rubocop
# run: bin/rubocop
# - name: Bundler Audit Action
# uses: andrewmcodes/bundler-audit-action@v0.1.0