Skip to content

Zerobounce integration #6449

Zerobounce integration

Zerobounce integration #6449

Workflow file for this run

name: CI Test Suite
on:
push:
branches: [develop, main]
pull_request:
types: [labeled, opened, synchronize, reopened]
workflow_dispatch:
jobs:
tests:
name: Running tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PostgreSQL
uses: Harmon758/[email protected]
with:
postgresql version: 14.9-alpine3.18
postgresql db: miru_web_test_${{ github.event.number }}
postgresql user: root
postgresql password: "password"
- name: Setup ElasticSearch
uses: ankane/setup-elasticsearch@v1
- name: Setup chrome
uses: nanasess/setup-chromedriver@v2
with:
# Optional: do not specify to match Chrome's version
chromedriver-version: "88.0.4324.96"
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- name: Check if Elasticsearch is reachable
run: |
curl --verbose --show-error http://localhost:9200
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Audit gems
run: |
bundle exec bundle-audit --update
bundle exec ruby-audit check
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18.14.2
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Setup kernel for guard, increase watchers
run: |
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Setup Env's
run: |
cp .env.example .env
- name: ffi pristine
run: bundle pristine ffi
- name: Setup test database
env:
RAILS_ENV: test
DB_USER: root
DB_PASS: "password"
TEST_ENV_NUMBER: ${{ github.event.number }}
run: |
bundle exec rails db:prepare
- name: Run Rubocop
run: |
bundle exec rubocop
- name: Run tests
env:
RAILS_ENV: test
DB_USER: root
DB_PASS: "password"
TEST_ENV_NUMBER: ${{ github.event.number }}
run:
bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"
- name: Run Eslint
run: |
npx eslint "./app/javascript/**/*.{ts,tsx,js,jsx,json}"