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