<commit_before>name: Test & lint
on: [push]

env:
  RAILS_ENV: test
  PGHOST: localhost
  PGUSER: postgres

jobs:
  tests:
    name: Test & lint
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.4', '2.5', '2.6', '2.7', 'jruby']
        gemfile: ['gemfiles/activerecord_4.2.0.gemfile', 'gemfiles/activerecord_5.0.2.gemfile', 'gemfiles/activerecord_5.1.0.gemfile', 'gemfiles/activerecord_5.2.2.gemfile', 'gemfiles/activerecord_6.0.0.gemfile', 'gemfiles/activerecord_6.1.0.gemfile', 'gemfiles/activerecord_master.gemfile']
        exclude:
          - gemfile: 'gemfiles/activerecord_4.2.0.gemfile'
            ruby: '2.7' # rails 4.2 can't run on ruby 2.7 due to BigDecimal API change
          - gemfile: 'gemfiles/activerecord_6.0.0.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_6.1.0.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_master.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_5.0.2.gemfile'
            ruby: 'jruby' # this *should* work - there's a test failure; it's not incompatible like the other excludes. could be an issue in Rails 5.0.2?
          - gemfile: 'gemfiles/activerecord_6.1.0.gemfile'
            ruby: 'jruby' # this *should* work. it seems like there's an issue with rails 6 on jruby.
          - gemfile: 'gemfiles/activerecord_master.gemfile'
            ruby: 'jruby' # this *should* work. it seems like there's an issue with rails 6 on jruby.

    services:
      postgres:
        image: postgres
        env:
          POSTGRES_USER: postgres
          POSTGRES_DB: cancan_postgresql_spec
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports: ["5432:5432"]

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: '20'

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Install bundler
        run: gem install bundler

      # https://github.com/CanCanCommunity/cancancan/pull/669#issuecomment-748019539
      - name: Nokogiri support for Truffleruby
        run: sudo apt-get -yqq install libxml2-dev libxslt-dev
        if: ${{ matrix.ruby == 'truffleruby' }}

      - name: Install gems
        run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle install --jobs 2

      - name: Run linter
        run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop

      - name: Run tests on sqlite
        run: DB=sqlite BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rake

      - name: Run tests on postgres
        run: DB=postgres BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rake<commit_msg>put bundle gemfile in env<commit_after>name: Test & lint
on: [push]

env:
  RAILS_ENV: test
  PGHOST: localhost
  PGUSER: postgres

jobs:
  tests:
    name: Test & lint
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.4', '2.5', '2.6', '2.7', 'jruby']
        gemfile: ['gemfiles/activerecord_4.2.0.gemfile', 'gemfiles/activerecord_5.0.2.gemfile', 'gemfiles/activerecord_5.1.0.gemfile', 'gemfiles/activerecord_5.2.2.gemfile', 'gemfiles/activerecord_6.0.0.gemfile', 'gemfiles/activerecord_6.1.0.gemfile', 'gemfiles/activerecord_master.gemfile']
        exclude:
          - gemfile: 'gemfiles/activerecord_4.2.0.gemfile'
            ruby: '2.7' # rails 4.2 can't run on ruby 2.7 due to BigDecimal API change
          - gemfile: 'gemfiles/activerecord_6.0.0.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_6.1.0.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_master.gemfile'
            ruby: '2.4' # rails 6+ requires ruby 2.5+
          - gemfile: 'gemfiles/activerecord_5.0.2.gemfile'
            ruby: 'jruby' # this *should* work - there's a test failure; it's not incompatible like the other excludes. could be an issue in Rails 5.0.2?
          - gemfile: 'gemfiles/activerecord_6.1.0.gemfile'
            ruby: 'jruby' # this *should* work. it seems like there's an issue with rails 6 on jruby.
          - gemfile: 'gemfiles/activerecord_master.gemfile'
            ruby: 'jruby' # this *should* work. it seems like there's an issue with rails 6 on jruby.

    env:
      BUNDLE_GEMFILE: ${{ matrix.gemfile }}

    services:
      postgres:
        image: postgres
        env:
          POSTGRES_USER: postgres
          POSTGRES_DB: cancan_postgresql_spec
          POSTGRES_PASSWORD: <PASSWORD>
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports: ["5432:5432"]

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: '20'

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Install bundler
        run: gem install bundler

      # https://github.com/CanCanCommunity/cancancan/pull/669#issuecomment-748019539
      - name: Nokogiri support for Truffleruby
        run: sudo apt-get -yqq install libxml2-dev libxslt-dev
        if: ${{ matrix.ruby == 'truffleruby' }}

      - name: Install gems
        run: bundle install --jobs 2

      - name: Run linter
        run: bundle exec rubocop

      - name: Run tests on sqlite
        run: DB=sqlite bundle exec rake

      - name: Run tests on postgres
        run: DB=postgres bundle exec rake
{'fraction_non_alphanumeric': 0.11398071625344353, 'fraction_numerical': 0.03340220385674931, 'mean_word_length': 2.1847587719298245, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '892238', 'n_tokens_mistral': 2152, 'n_tokens_neox': 1926, 'n_words': 492}