-
Notifications
You must be signed in to change notification settings - Fork 60
80 lines (67 loc) · 2.04 KB
/
Copy pathci.yml
File metadata and controls
80 lines (67 loc) · 2.04 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
74
75
76
77
78
79
80
name: CI
on:
pull_request:
push:
branches:
- main
- staging
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prechecks:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DB_ENCODING: SQL_ASCII
DB_PORT: 5432
DB_SEARCH_PATH: oh,oa,fis,public
TEST_DB_HOST: 127.0.0.1
TEST_DB_NAME: oh_test
TEST_DB_USERNAME: postgres
TEST_DB_PASSWORD: postgres
steps:
- name: Checkout Ohloh UI
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsodium-dev imagemagick
- name: Setup Ruby
uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0
with:
ruby-version: .ruby-version
bundler-cache: false
- name: Bundle install
run: |
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Rubocop
run: bundle exec rubocop
- name: Bundle Audit
run: |
bundle exec bundle-audit update
bundle exec bundle-audit check
continue-on-error: true
- name: Setup test environment
run: |
rm -f log/test.log
bundle exec bin/rails db:environment:set RAILS_ENV=test 2> /dev/null || true
bundle exec rake db:drop || true
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:structure:load RAILS_ENV=test
bundle exec rake db:migrate RAILS_ENV=test
- name: Run tests
run: RAILS_ENV=test bundle exec rake test