Merge branch 'trunk' into 187912648_propshaft #1505
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "20" | |
- 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: build js and css | |
run: | | |
yarn build | |
yarn build:css | |
# 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 |