<commit_before>name: Go-related checks

# Any change in triggers needs to be reflected in the concurrency group.
on:
  pull_request: {}
  push:
    branches:
      - master
      - ft/master/**

permissions: read-all

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
  cancel-in-progress: true

jobs:
  go-mod:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
      - name: Check module vendoring
        run: |
          go mod tidy
          go mod vendor
          test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1)
      - name: Send slack notification
        if: ${{ !success() && (github.event_name == 'schedule' || github.event_name == 'push') }}
        uses: 8398a7/action-slack@a74b761b4089b5d730d813fbedcd2ec5d394f3af
        with:
          status: ${{ job.status }}
          fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
      - name: Run golangci-lint
        uses: golangci/golangci-lint-action@b517f99ae23d86ecc4c0dec08dcf48d2336abc29
        with:
          version: v1.45.2
          skip-cache: true
      - name: Send slack notification
        if: ${{ !success() && (github.event_name == 'schedule' || github.event_name == 'push') }}
        uses: 8398a7/action-slack@a74b761b4089b5d730d813fbedcd2ec5d394f3af
        with:
          status: ${{ job.status }}
          fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

  precheck:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
          # hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
          path: src/github.com/cilium/cilium
      - name: Go code prechecks
        run: |
          cd src/github.com/cilium/cilium
          make precheck<commit_msg>build(deps): bump golangci/golangci-lint-action from 3.1.0 to 3.2.0<commit_after>name: Go-related checks

# Any change in triggers needs to be reflected in the concurrency group.
on:
  pull_request: {}
  push:
    branches:
      - master
      - ft/master/**

permissions: read-all

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
  cancel-in-progress: true

jobs:
  go-mod:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
      - name: Check module vendoring
        run: |
          go mod tidy
          go mod vendor
          test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1)
      - name: Send slack notification
        if: ${{ !success() && (github.event_name == 'schedule' || github.event_name == 'push') }}
        uses: 8398a7/action-slack@a74b761b4089b5d730d813fbedcd2ec5d394f3af
        with:
          status: ${{ job.status }}
          fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
      - name: Run golangci-lint
        uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc
        with:
          version: v1.45.2
          skip-cache: true
      - name: Send slack notification
        if: ${{ !success() && (github.event_name == 'schedule' || github.event_name == 'push') }}
        uses: 8398a7/action-slack@a74b761b4089b5d730d813fbedcd2ec5d394f3af
        with:
          status: ${{ job.status }}
          fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

  precheck:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2
        with:
          go-version: 1.18.1
      - name: Checkout code
        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
        with:
          persist-credentials: false
          # hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
          path: src/github.com/cilium/cilium
      - name: Go code prechecks
        run: |
          cd src/github.com/cilium/cilium
          make precheck
{'fraction_non_alphanumeric': 0.1012491781722551, 'fraction_numerical': 0.08678500986193294, 'mean_word_length': 2.453461975028377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3491760', 'n_tokens_mistral': 2406, 'n_tokens_neox': 2078, 'n_words': 421}