-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (73 loc) · 2.32 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
name: Run Test Suite on Draft Release Creation, Push, and Pull Request to master
on:
workflow_run:
workflows: [Create Release Draft]
types: [completed]
branches: [master]
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'push' || github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
services:
db:
image: postgres:12
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ldap:
image: rroemhild/test-openldap
ports:
- 389:10389
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- uses: actions/setup-node@v1
with:
node-version: '14'
- name: Cache ruby gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Build and run tests
env:
DATABASE_URL: postgres://postgres:@localhost:5432/test
RAILS_ENV: test
# Options below this line are so we can test LDAP
VULCAN_ENABLE_LDAP: true
VULCAN_LDAP_ATTRIBUTE: mail
VULCAN_LDAP_BIND_DN: cn=admin,dc=planetexpress,dc=com
VULCAN_LDAP_BASE: ou=people,dc=planetexpress,dc=com
VULCAN_LDAP_PORT: 389
VULCAN_LDAP_ADMIN_PASS: GoodNewsEveryone
run: |
sudo apt-get -yqq install libpq-dev
echo "gem: --no-document" > ~/.gemrc
gem install bundler --conservative
bundle config path vendor/bundle
bin/setup
bundle exec rails spec
- name: Run Rubocop
run: bundle exec rubocop
- name: Run eslint
run: yarn lint:ci
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: coverage-report
path: coverage