github.com/anycable/anycable-go@v1.5.1/.github/workflows/benchmark.yml (about)

     1  name: Benchmark
     2  
     3  on:
     4    push:
     5      branches:
     6      - master
     7      paths:
     8      - "**/*.go"
     9      - "go.sum"
    10    workflow_dispatch:
    11    pull_request:
    12  
    13  jobs:
    14    benchmark:
    15      timeout-minutes: 10
    16      runs-on: ubuntu-latest
    17      env:
    18        GO111MODULE: on
    19        DEBUG: true
    20      services:
    21        redis:
    22          image: redis:6.0-alpine
    23          ports: ["6379:6379"]
    24          options: --health-cmd="redis-cli ping" --health-interval 1s --health-timeout 3s --health-retries 30
    25      steps:
    26      - uses: actions/checkout@v4
    27      - uses: actions/setup-go@v4
    28        with:
    29          go-version-file: go.mod
    30      - name: Install system deps
    31        run: |
    32          sudo apt-get update
    33          sudo apt-get install bison
    34      - uses: ruby/setup-ruby@v1
    35        with:
    36          # Use <3.0 since go-mruby's Rakefile has some problems with keyword arguments compatibility
    37          ruby-version: 2.7
    38          bundler-cache: true
    39      - uses: actions/cache@v3
    40        with:
    41          path: vendor
    42          key: vendor-${{ hashFiles('**/go.sum') }}
    43          restore-keys: |
    44            vendor-
    45      - run: go mod vendor
    46      - name: Build mruby
    47        run: bash -c '(cd vendor/github.com/mitchellh/go-mruby && MRUBY_CONFIG=../../../../../../etc/build_config.rb make libmruby.a)'
    48      - name: Install websocket-bench & gops
    49        env:
    50          GO111MODULE: off
    51        run: |
    52          go get -u github.com/anycable/websocket-bench
    53          go get -u github.com/google/gops
    54      - name: Build test binary
    55        env:
    56          BUILD_ARGS: "-race"
    57        run: |
    58          make build
    59      - name: Run benchmarks
    60        run: |
    61          bundle install
    62          make benchmarks