<commit_before>name: CI docker

on:
  push:
    branches:
      - develop
      - master
      - gpl769_test_cp_view
    paths-ignore:
      - "README.md"
    tags:
      - uat-*
      - release-*
      - v*
env:
  IMAGE_NAME: ${{ github.repository }}/${{ github.event.repository.name }}

jobs:
  build_and_test_job:
    runs-on: ubuntu-18.04
    env:
      DBHOST: 127.0.0.1 # If we use localhost, rails tries to use a socket
    services:
      mysql:
        image: mysql:5.7
        ports:
          - 3306:3306
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_ROOT_PASSWORD: <PASSWORD>
          MYSQL_DATABASE: event_warehouse_test
    steps:
      - uses: actions/checkout@v2
      - name: Build the Docker image
        run: >-
          docker build .
          --file Dockerfile
          --tag docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/}
      - name: Run Rubocop against the image
        run: >-
          docker run --network host 
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rubocop
      - name: Initialize testing database
        run: >-
          docker run --network host 
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rake db:create db:schema:load db:seed
      - name: Run tests against the image
        run: >-
          docker run --network host 
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rspec
      - name: Login to registry
        run: >-
          docker login
          -u ${{ github.actor }}
          -p ${{ secrets.GITHUB_TOKEN }}
          docker.pkg.github.com
      - name: Publish image with image tag being either develop/master/<tag_name>
        run: >-
          docker push
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/}<commit_msg>Try defining DBHOST inside the step<commit_after>name: CI docker

on:
  push:
    branches:
      - develop
      - master
      - gpl769_test_cp_view
    paths-ignore:
      - "README.md"
    tags:
      - uat-*
      - release-*
      - v*
env:
  IMAGE_NAME: ${{ github.repository }}/${{ github.event.repository.name }}

jobs:
  build_and_test_job:
    runs-on: ubuntu-18.04
    env:
      DBHOST: 127.0.0.1 # If we use localhost, rails tries to use a socket
    services:
      mysql:
        image: mysql:5.7
        ports:
          - 3306:3306
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_ROOT_PASSWORD: null
          MYSQL_DATABASE: event_warehouse_test
    steps:
      - uses: actions/checkout@v2
      - name: Build the Docker image
        run: >-
          docker build .
          --file Dockerfile
          --tag docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/}
      - name: Run Rubocop against the image
        run: >-
          docker run --network host --env DBHOST=127.0.0.1
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rubocop
      - name: Initialize testing database
        run: >-
          docker run --network host --env DBHOST=127.0.0.1
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rake db:create db:schema:load db:seed
      - name: Run tests against the image
        run: >-
          docker run --network host --env DBHOST=127.0.0.1
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/} 
          bundle exec rspec
      - name: Login to registry
        run: >-
          docker login
          -u ${{ github.actor }}
          -p ${{ secrets.GITHUB_TOKEN }}
          docker.pkg.github.com
      - name: Publish image with image tag being either develop/master/<tag_name>
        run: >-
          docker push
          docker.pkg.github.com/${IMAGE_NAME}:${GITHUB_REF##*/}
{'fraction_non_alphanumeric': 0.117740232312566, 'fraction_numerical': 0.017423442449841606, 'mean_word_length': 1.7496371552975327, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, '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': '5371814', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1206, 'n_words': 280}