Sha256: d80a14bb38cbf33cc322a89251339adee64cf87b408100a6d39570ddb00fff3d

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 KB

Contents

name: Ruby

on:
  push:
    branches:
      - main

  pull_request:
    branches:
      - main

env:
  RAILS_ENV: test
  DB_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false

      matrix:
        ruby:
          - '3.0'
          - '3.1'
        activerecord:
          - '6.0'
          - '6.1'
          - '7.0'
          - '7.1'
    services:
      mysql:
        image: mysql:8
        ports:
          - 3306:3306
        env:
          MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
          MYSQL_DATABASE: ${{ env.DB_NAME }}
        options: >-
          --health-cmd "mysqladmin ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    env:
      BUNDLE_GEMFILE: gemfiles/activerecord${{ matrix.activerecord }}.gemfile
      DB_HOST: 127.0.0.1

    steps:
      - uses: actions/checkout@v2

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
          cache-version: 1

      - name: set MySQL sql_mode
        run: |
          mysql --ssl-mode=DISABLE --get-server-public-key --protocol=tcp --host 127.0.0.1 --user=root --password=${{ env.DB_PASSWORD }} mysql <<SQL
          SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
          SET GLOBAL character_set_server = 'latin1';
          SET GLOBAL innodb_file_per_table = ON;
          SQL

      - name: set ENV
        run: |
          echo "DB_PORT=${{ job.services.mysql.ports[3306] }}" >> $GITHUB_ENV

      - name: Setup DB
        run: |
          ./scripts/setup.sh
        continue-on-error: ${{ matrix.allow_failures == 'true' }}

      - name: Run tests
        run: bundle exec rspec
        continue-on-error: ${{ matrix.allow_failures == 'true' }}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gizzard-0.8.0 .github/workflows/main.yml