<commit_before>---
name: test

on:
  push:
  pull_request:

jobs:
  rspec:
    runs-on: ubuntu-20.04

    services:
      postgres:
        image: postgres:14-alpine
        env:
          POSTGRES_PASSWORD: <PASSWORD>
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    env:
      TZ: Europe/Berlin
      DATABASE_URL: postgresql://postgres:secret@localhost:5432

    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.0"
          bundler-cache: true

      - name: Setup
        run: |
          bundle exec rake db:create:all db:setup
          sudo bash -c "echo 127.0.1.2 openmensa.org >> /etc/hosts"
      - run: bundle exec rspec spec --tag ~type:feature --format doc
      - run: bundle exec rspec spec --tag type:feature --format doc

  rubocop:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.0"
          bundler-cache: true
      - run: bundle exec rubocop --color --parallel --fail-level E

  docker:
    needs: rspec
    if: always()

    runs-on: ubuntu-22.04

    env:
      REGISTRY: ghcr.io
      IMAGE_NAME: ${{ github.repository }}

    steps:
      - uses: actions/checkout@v3

      # https://github.com/marketplace/actions/build-and-push-docker-images
      - uses: docker/setup-buildx-action@v2

      - uses: docker/login-action@v1
        with:
          registry: ${{ env.REGISTRY }}<commit_msg>chore(ci): Always colorize rspec ouput<commit_after>---
name: test

on:
  push:
  pull_request:

jobs:
  rspec:
    runs-on: ubuntu-20.04

    services:
      postgres:
        image: postgres:14-alpine
        env:
          POSTGRES_PASSWORD: <PASSWORD>
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    env:
      TZ: Europe/Berlin
      DATABASE_URL: postgresql://postgres:secret@localhost:5432

    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.0"
          bundler-cache: true

      - name: Setup
        run: |
          bundle exec rake db:create:all db:setup
          sudo bash -c "echo 127.0.1.2 openmensa.org >> /etc/hosts"
      - run: bundle exec rspec spec --color --tag ~type:feature --format doc
      - run: bundle exec rspec spec --color --tag type:feature --format doc

  rubocop:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.0"
          bundler-cache: true
      - run: bundle exec rubocop --color --parallel --fail-level E

  docker:
    needs: rspec
    if: always()

    runs-on: ubuntu-22.04

    env:
      REGISTRY: ghcr.io
      IMAGE_NAME: ${{ github.repository }}

    steps:
      - uses: actions/checkout@v3

      # https://github.com/marketplace/actions/build-and-push-docker-images
      - uses: docker/setup-buildx-action@v2

      - uses: docker/login-action@v1
        with:
          registry: ${{ env.REGISTRY }}
{'fraction_non_alphanumeric': 0.1185614142029869, 'fraction_numerical': 0.028649801889667783, 'mean_word_length': 1.7236514522821578, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '742124', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1086, 'n_words': 246}