-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (141 loc) · 4.31 KB
/
quality_workbench.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Quality Workbench
on:
push:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
concurrency:
group: qb-${{ github.ref }}-automated-test
cancel-in-progress: true
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- name: Cache Gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-medicaid_gateway-gems-mitc-service-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-medicaid_gateway-gems-mitc-service-${{ hashFiles('**/Gemfile.lock') }}
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
- name: Run rubocop
run: bundle exec rubocop
mitc_service:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:4.2
ports:
- 27017:27017
options: >-
--name "mongo"
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
- uses: ruby/setup-ruby@v1
- name: Cache Gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-medicaid_gateway-gems-mitc-service-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-medicaid_gateway-gems-mitc_service-${{ hashFiles('**/Gemfile.lock') }}
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
cd components/mitc_service
bundle config path ../../vendor/bundle
bundle install
- name: run tests
run: |
echo
cd components/mitc_service
sudo bash -c "echo '127.0.0.1 rabbitmq mongodb' >> /etc/hosts"
bundle exec rspec
rspec:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
- 15672:15672
options: >-
--name "rabbitmq"
--health-cmd "rabbitmqctl node_health_check"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongo:
image: mongo:4.2
ports:
- 27017:27017
options: >-
--name "mongo"
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
- run: |
docker exec rabbitmq rabbitmqctl add_vhost /
docker exec rabbitmq rabbitmqctl add_vhost event_source
docker exec rabbitmq rabbitmqctl set_permissions -p event_source guest ".*" ".*" ".*"
- uses: ruby/setup-ruby@v1
- name: Cache Gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-medicaid_gateway-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-medicaid_gateway-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
- name: Restore Node Modules
id: npm-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node_modules-v12-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-v12-${{ hashFiles('yarn.lock') }}
- name: yarn install
if: steps.npm-cache.outputs.cache-hit != 'true'
run: |
yarn install
- name: run webpack
run: |
echo bundle config
bundle config path vendor/bundle
NODE_ENV=test RAILS_ENV=test ./bin/webpack
# Need this step in order to access the mongodb server
- name: set etc host
run: sudo bash -c "echo '127.0.0.1 rabbitmq mongodb' >> /etc/hosts"
- name: run tests
run: bundle exec rspec