<commit_before>on:
  - pull_request
permissions:
  contents: read
name: CI
jobs:
  build:
    strategy:
      matrix:
        go-version: [1.17.x, 1.18.x, 1.19.x]
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          go-version: ${{ matrix.go-version }}
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: go build ./...
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: go test ./...
  node_test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
        with:
          node-version: 10
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - run: >
          cd examples/internal/browser &&
          npm install gulp-cli &&
          npm install &&
          ./node_modules/.bin/gulp
  generate:
    container:
      image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
      options: "--user root"
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: make install
      - run: make clean
      - run: make generate
      - run: go mod tidy
      - run: git diff --exit-code
  bazel:
    container:
      image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
      options: "--user root"
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
        with:
          path: /home/vscode/.cache/_grpc_gateway_bazel
          key: v1-bazel-cache-${{ hashFiles('repositories.bzl') }}
          restore-keys: v1-bazel-cache-
      - name: Configure bazel
        run: |
          cat > .bazelrc << EOF
          startup --output_base /home/vscode/.cache/_grpc_gateway_bazel
          build --test_output errors
          build --features race
          # Workaround https://github.com/bazelbuild/bazel/issues/3645
          # See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
          build --local_ram_resources=7168 # Github runners have 7G of memory
          build --local_cpu_resources=2    # Github runners have 2 vCPU
          EOF
      - name: Check that Bazel BUILD files are up-to-date
        run: bazel run //:gazelle && git diff --exit-code
      - name: Check that repositories.bzl is up-to-date
        run: |
          bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories &&
          git diff --exit-code
      - name: Check formatting of Bazel BUILD files
        run: bazel run //:buildifier && git diff --exit-code
      - name: Run tests with Bazel
        run: bazel test //...
  gorelease:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          go-version: 1.19
          check-latest: true
      - run: go run golang.org/x/exp/cmd/gorelease@latest -base=v2.12.0
  proto_lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - run: make install
      - run: PATH=$PATH:~/go/bin buf build
      - run: PATH=$PATH:~/go/bin buf lint
      - run: PATH=$PATH:~/go/bin buf format -w && git diff --exit-code
      - run: PATH=$PATH:~/go/bin buf breaking --path protoc-gen-openapiv2/ --against 'https://github.com/grpc-ecosystem/grpc-gateway.git#branch=master'
  golangci:
    permissions:
      pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 # tag=v3
        with:
          version: v1.45
          args: --enable goimports
  fuzz:
    runs-on: ubuntu-latest
    steps:
      - name: Build Fuzzers
        id: build<commit_msg>Update gorelease base<commit_after>on:
  - pull_request
permissions:
  contents: read
name: CI
jobs:
  build:
    strategy:
      matrix:
        go-version: [1.17.x, 1.18.x, 1.19.x]
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          go-version: ${{ matrix.go-version }}
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: go build ./...
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: go test ./...
  node_test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
        with:
          node-version: 10
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - run: >
          cd examples/internal/browser &&
          npm install gulp-cli &&
          npm install &&
          ./node_modules/.bin/gulp
  generate:
    container:
      image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
      options: "--user root"
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - run: make install
      - run: make clean
      - run: make generate
      - run: go mod tidy
      - run: git diff --exit-code
  bazel:
    container:
      image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.19
      options: "--user root"
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
        with:
          path: /home/vscode/.cache/_grpc_gateway_bazel
          key: v1-bazel-cache-${{ hashFiles('repositories.bzl') }}
          restore-keys: v1-bazel-cache-
      - name: Configure bazel
        run: |
          cat > .bazelrc << EOF
          startup --output_base /home/vscode/.cache/_grpc_gateway_bazel
          build --test_output errors
          build --features race
          # Workaround https://github.com/bazelbuild/bazel/issues/3645
          # See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
          build --local_ram_resources=7168 # Github runners have 7G of memory
          build --local_cpu_resources=2    # Github runners have 2 vCPU
          EOF
      - name: Check that Bazel BUILD files are up-to-date
        run: bazel run //:gazelle && git diff --exit-code
      - name: Check that repositories.bzl is up-to-date
        run: |
          bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories &&
          git diff --exit-code
      - name: Check formatting of Bazel BUILD files
        run: bazel run //:buildifier && git diff --exit-code
      - name: Run tests with Bazel
        run: bazel test //...
  gorelease:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          go-version: 1.19
          check-latest: true
      - run: go run golang.org/x/exp/cmd/gorelease@latest -base=v2.13.0
  proto_lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # tag=v3
        with:
          check-latest: true
      - run: make install
      - run: PATH=$PATH:~/go/bin buf build
      - run: PATH=$PATH:~/go/bin buf lint
      - run: PATH=$PATH:~/go/bin buf format -w && git diff --exit-code
      - run: PATH=$PATH:~/go/bin buf breaking --path protoc-gen-openapiv2/ --against 'https://github.com/grpc-ecosystem/grpc-gateway.git#branch=master'
  golangci:
    permissions:
      pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
      - uses: golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1 # tag=v3
        with:
          version: v1.45
          args: --enable goimports
  fuzz:
    runs-on: ubuntu-latest
    steps:
      - name: Build Fuzzers
        id: build
{'fraction_non_alphanumeric': 0.11054663686242634, 'fraction_numerical': 0.08717740296687665, 'mean_word_length': 2.3041289023162137, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, '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': '83528', 'n_tokens_mistral': 4125, 'n_tokens_neox': 3676, 'n_words': 651}