<commit_before>name: Dev
on:
  push:
    branches:
      - develop

jobs:
  build-local:
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - uses: actions/setup-node@v3
        with: { node-version: '16' }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: task deps

      - run: task compile

      - name: Test that compile did not create/modify untracked files
        run: git diff --exit-code --stat -- . ':(exclude)web2/package.json' ':(exclude)web2/package-lock.json' ':(exclude)go.mod' ':(exclude)go.sum'

      - run: task build:local

      - uses: actions/upload-artifact@master
        with:
          name: semaphore
          path: bin/semaphore


  test-golang:
    runs-on: [ubuntu-latest]
    needs: build-local
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: task deps:tools
      - run: task deps:be
      - run: task compile:be
#      - run: task lint:be
      - run: task test


  test-db-migration:
    runs-on: [ubuntu-latest]
    needs: [build-local, test-golang]
    steps:
      - uses: shogo82148/actions-setup-mysql@v1
        with:
          mysql-version: '5.6'

      - uses: actions/download-artifact@master
        with:
          name: semaphore

      - run: "cat > config.json <<EOF\n{\n\t\"mysql\": {\n\t\t\"host\": \"127.0.0.1:3306\"\
          ,\n\t\t\"user\": \"root\",\n\t\t\"pass\": \"\",\n\t\t\"name\": \"circle_test\"\
          \n\t},\n\t\"email_alert\": false\n}\nEOF\n"

      - run: chmod +x ./semaphore && ./semaphore migrate --config config.json

  test-integration:
    runs-on: [ubuntu-latest]
    needs: [test-db-migration]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: context=ci task dc:up


  deploy-dev:
    runs-on: [ubuntu-latest]
   needs: [build-local, test-golang]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }
<commit_msg>ci: fix workflow file format<commit_after>name: Dev
on:
  push:
    branches:
      - develop

jobs:
  build-local:
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - uses: actions/setup-node@v3
        with: { node-version: '16' }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: task deps

      - run: task compile

      - name: Test that compile did not create/modify untracked files
        run: git diff --exit-code --stat -- . ':(exclude)web2/package.json' ':(exclude)web2/package-lock.json' ':(exclude)go.mod' ':(exclude)go.sum'

      - run: task build:local

      - uses: actions/upload-artifact@master
        with:
          name: semaphore
          path: bin/semaphore


  test-golang:
    runs-on: [ubuntu-latest]
    needs: build-local
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: task deps:tools
      - run: task deps:be
      - run: task compile:be
#      - run: task lint:be
      - run: task test


  test-db-migration:
    runs-on: [ubuntu-latest]
    needs: [build-local, test-golang]
    steps:
      - uses: shogo82148/actions-setup-mysql@v1
        with:
          mysql-version: '5.6'

      - uses: actions/download-artifact@master
        with:
          name: semaphore

      - run: "cat > config.json <<EOF\n{\n\t\"mysql\": {\n\t\t\"host\": \"127.0.0.1:3306\"\
          ,\n\t\t\"user\": \"root\",\n\t\t\"pass\": \"\",\n\t\t\"name\": \"circle_test\"\
          \n\t},\n\t\"email_alert\": false\n}\nEOF\n"

      - run: chmod +x ./semaphore && ./semaphore migrate --config config.json

  test-integration:
    runs-on: [ubuntu-latest]
    needs: [test-db-migration]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

      - run: go install github.com/go-task/task/v3/cmd/task@latest

      - uses: actions/checkout@v3

      - run: context=ci task dc:up


  deploy-dev:
    runs-on: [ubuntu-latest]
    needs: [build-local, test-golang]
    steps:
      - uses: actions/setup-go@v3
        with: { go-version: 1.18 }

{'fraction_non_alphanumeric': 0.16039823008849557, 'fraction_numerical': 0.01991150442477876, 'mean_word_length': 1.9319066147859922, 'pattern_counts': {'":': 12, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3678397', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1623, 'n_words': 330}