<commit_before>name: Tests

on: [push, pull_request]

env:
  APP_ENV: testing
  APP_KEY: base64:<KEY>
  APP_URL: http://localhost:8000
  CACHE_DRIVER: redis
  CACHE_DRIVER_LOCAL: array
  DB_HOST: 127.0.0.1
  DB_USERNAME: root
  ES_SOLO_SCORES_HOST: http://localhost:9201
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  NOTIFICATION_ENDPOINT: ws://127.0.0.1:2345
  NOTIFICATION_REDIS_HOST: 127.0.0.1
  OSU_INSTALL_DEV: 1
  OSU_USE_SYSTEM_COMPOSER: 1
  PAYMENT_SANDBOX: true
  PASSPORT_PRIVATE_KEY: |+
    -----BEGIN PRIVATE KEY-----
    <KEY>
    c/<KEY>
    -----END PRIVATE KEY-----
  PASSPORT_PUBLIC_KEY: |+
    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHr8GcHjNsY+RhbxWNJcxOG/yE
    BCATtDZDAXL9RNs0A+5eHBhH7f/5LGaz9pectJfhQi/9te/G7foGYKF2pVU640GI
    bT9Qd8p4Kbvjezu+SU/sWmzCxLAhJ7LhciJ305fpFBnIql/HyHRC8fU4MeZ8BZDa
    oROWKN35IUY54zGh4QIDAQAB
    -----END PUBLIC KEY-----
  REDIS_HOST: 127.0.0.1
  SESSION_DRIVER: redis
  SHOPIFY_DOMAIN: notarealdomainortld
  SHOPIFY_STOREFRONT_TOKEN: <PASSWORD>
  SLACK_ENDPOINT: https://myconan.net/null/

jobs:
  tests:
    strategy:
      matrix:
        php: ['8.0']
    name: Tests
    runs-on: ubuntu-latest
    services:
      db:
        image: mysql:8.0
        ports:
          - 3306:3306
        options: >-
          --health-cmd="mysqladmin ping"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=5
          -e MYSQL_ALLOW_EMPTY_PASSWORD=1
          --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"

      elasticsearch:
        env:
          action.auto_create_index: "false"
          discovery.type: single-node
          # Bundled by 6.8.x image and doesn't work when auto_create_index is disabled.
          # Doesn't seem to exist in 7.x anymore (or they fixed the index creation process).
          xpack.watcher.enabled: "false"
        image: elasticsearch:6.8.23
        ports:
          - 9200:9200

      elasticsearch-score:
        env:
          action.auto_create_index: "false"
          discovery.type: single-node
        image: elasticsearch:7.17.5
        ports:
          - 9201:9200

      redis:
        image: redis
        ports:
          - 6379:6379

      osu-beatmap-difficulty-lookup-cache:
        image: pppy/osu-beatmap-difficulty-lookup-cache
        ports:
          - 5000:80

      osu-elastic-indexer:
        image: pppy/osu-elastic-indexer
        # make sure the schema specified here and the one in set-schema command match
        options: >-
          -e DB_CONNECTION_STRING=Server=db;Database=osu;Uid=root
          -e ES_HOST=http://elasticsearch-score:9200
          -e REDIS_HOST=redis
          -e schema=test
          --entrypoint sh pppy/osu-elastic-indexer -c "exec dotnet osu.ElasticIndexer.dll queue"

      osu-notification-server:<commit_msg>Update env name for score indexer service<commit_after>name: Tests

on: [push, pull_request]

env:
  APP_ENV: testing
  APP_KEY: <KEY>
  APP_URL: http://localhost:8000
  CACHE_DRIVER: redis
  CACHE_DRIVER_LOCAL: array
  DB_HOST: 127.0.0.1
  DB_USERNAME: root
  ES_SOLO_SCORES_HOST: http://localhost:9201
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  NOTIFICATION_ENDPOINT: ws://127.0.0.1:2345
  NOTIFICATION_REDIS_HOST: 127.0.0.1
  OSU_INSTALL_DEV: 1
  OSU_USE_SYSTEM_COMPOSER: 1
  PAYMENT_SANDBOX: true
  PASSPORT_PRIVATE_KEY: |+
    -----BEGIN PRIVATE KEY-----
    <KEY>
    FY0lzE4b/<KEY>//ksZrP2l5y0l+FCL/2178bt+gZg
    oXalVTrjQYhtP1B3yngpu+N7O75JT+xabMLEsCEnsuFyInfTl+kUGciqX8fIdELx
    9Tgx5nwFkNqhE5Yo3fkhRjnjMaHhAgMBAAECgYEAsIrFvFXDFwAVyMKiJiEVyLTb
    gof3KBR6qLDeTeaTeiBDnPZvzSAw38YOourPzd6oLKIMtd0lORXqp7rE5ZV0jEOo
    QhDuahbMwfTeDOihhTTyc0ZxtY4WlVuV3lbNLZYSKXwpNU/Dud9mWyqSnS5+QcrF
    c/Z6mxpVS6cxBFxrAaUCQQD0LHfl9R3aZbRPpDRX61eOi2wT96dZVi0IV+Yq4qqJ
    L/ZDxCpTBx5xMvVqmET7Q69KULzUfajHOgkW3h+JA8vTAkEA0VuwDMcF6N4TGrpE
    7rwLdFrXVopDCf1IT+y0spf52RUe7dGsUPz+Ed1oQ55S+ZPjAiHIF/EDGhtGkhbc
    h5fO+wJATVe0ltOgpCgpCD0UE3FJZ66ECoMcsDCazRTCpHzt1cyqbea6HViY7PRe
    Rmh7GTfkU17loU04Y/rfHC45wPXB3wJARE7dHx4kwHkM1LCn4xj5x8oH7pWIEA9S
    87jwsEDD5V9tyvyZc4dIQn3yEfXrbsEg1UY+aglaEL+LhAjvhVIz1wJBANGE8xeu
    qLUIE7/3nfacXiK/v02qKlW6++LrvSzgAOLsYyqfYpfmKffSdkTxFIZ8wUjufuOT
    DPxkn/u5C+BuAqQ=
    -----END PRIVATE KEY-----
  PASSPORT_PUBLIC_KEY: |+
    -----BEGIN PUBLIC KEY-----
    <KEY>LAhJ7LhciJ305fpFBnIql/HyHRC8fU4MeZ8BZDa
    oROWKN35IUY54zGh4QIDAQAB
    -----END PUBLIC KEY-----
  REDIS_HOST: 127.0.0.1
  SESSION_DRIVER: redis
  SHOPIFY_DOMAIN: notarealdomainortld
  SHOPIFY_STOREFRONT_TOKEN: <PASSWORD>
  SLACK_ENDPOINT: https://myconan.net/null/

jobs:
  tests:
    strategy:
      matrix:
        php: ['8.0']
    name: Tests
    runs-on: ubuntu-latest
    services:
      db:
        image: mysql:8.0
        ports:
          - 3306:3306
        options: >-
          --health-cmd="mysqladmin ping"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=5
          -e MYSQL_ALLOW_EMPTY_PASSWORD=1
          --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"

      elasticsearch:
        env:
          action.auto_create_index: "false"
          discovery.type: single-node
          # Bundled by 6.8.x image and doesn't work when auto_create_index is disabled.
          # Doesn't seem to exist in 7.x anymore (or they fixed the index creation process).
          xpack.watcher.enabled: "false"
        image: elasticsearch:6.8.23
        ports:
          - 9200:9200

      elasticsearch-score:
        env:
          action.auto_create_index: "false"
          discovery.type: single-node
        image: elasticsearch:7.17.5
        ports:
          - 9201:9200

      redis:
        image: redis
        ports:
          - 6379:6379

      osu-beatmap-difficulty-lookup-cache:
        image: pppy/osu-beatmap-difficulty-lookup-cache
        ports:
          - 5000:80

      osu-elastic-indexer:
        image: pppy/osu-elastic-indexer
        # make sure the schema specified here and the one in set-schema command match
        options: >-
          -e DB_CONNECTION_STRING=Server=db;Database=osu;Uid=root
          -e ES_HOST=http://elasticsearch-score:9200
          -e REDIS_HOST=redis
          -e SCHEMA=test
          --entrypoint sh pppy/osu-elastic-indexer -c "exec dotnet osu.ElasticIndexer.dll queue"

      osu-notification-server:
{'fraction_non_alphanumeric': 0.09594552770040235, 'fraction_numerical': 0.05462705044877747, 'mean_word_length': 2.553051126992853, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '2237359', 'n_tokens_mistral': 2872, 'n_tokens_neox': 2621, 'n_words': 389}