Docker Heroku #62
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: "CI" | |
on: | |
push: | |
branches: [ "main", "master" ] | |
pull_request: | |
branches: [ "main", "master" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_DB: cms_test | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- '3306:3306' | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
env: | |
ALGOLIA_APP_ID: test | |
ALGOLIA_API_KEY: test | |
APP_NAME: MAS | |
BUNDLE_GEM__FURY__IO: ${{ secrets.BUNDLE_GEM__FURY__IO }} | |
FARADAY_HOST: 'localhost:5000' | |
FARADAY_X_FORWARDED_PROTO: 'http' | |
MAILJET_DEFAULT_FROM_ADDRESS: notmonitored@notify.moneyadviceservice.org.uk | |
MAS_CMS_URL: 'http://localhost:3000/' | |
MAS_PUBLIC_WEBSITE_URL: 'http://localhost:5000' | |
MAS_PUBLIC_WEBSITE_DOMAIN: 'localhost:5000' | |
MAS_CMS_API_TOKEN: mytoken | |
RAILS_ENV: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install matching chromedriver | |
uses: nanasess/setup-chromedriver@v2 | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3.5.1 | |
with: | |
node-version: 4.1.1 | |
- name: Install bower | |
run: npm install -g bower | |
- name: Install bowndler packages | |
run: bundle exec bowndler update | |
- name: Precompile assets to speed up Puma test server start time | |
run: bundle exec rake assets:precompile | |
- name: Set up database schema | |
run: | | |
bundle exec rake db:create db:schema:load | |
- name: Run tests | |
run: | | |
bundle exec rspec | |
bundle exec cucumber |