From 64be865bc3916e3f58258d2b68f538ccc92f8c24 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 21:33:34 +0200 Subject: [PATCH 1/6] ci: add github action workflow for build --- .github/workflows/go.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..0866fc4 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,37 @@ +name: Go + +on: + push: + branches: [ v0 ] + pull_request: + branches: [ v0 ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -v . + + - name: Test + run: go test -v . From 5dbaaab3ded88131ef42ec91808f67dcc6282910 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 21:36:42 +0200 Subject: [PATCH 2/6] Update go.yml --- .github/workflows/go.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0866fc4..7d3f0dd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,16 +22,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v . - - name: Test - run: go test -v . + run: make test + + - name: Bench + run: make bench From edaf7f1b486864cf4e2202a4fd1e9a2fd16a744f Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 21:43:41 +0200 Subject: [PATCH 3/6] Update go.yml --- .github/workflows/go.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7d3f0dd..068052d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,4 +26,10 @@ jobs: run: make test - name: Bench - run: make bench + run: make bench | tee bench-output.txt + + - name: Store benchmark result + uses: rhysd/github-action-benchmark@v1 + with: + tool: 'go' + output-file-path: bench-output.txt From b2ee8fa2e13ed10b73c39e36eea68f42ef016d09 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 21:54:03 +0200 Subject: [PATCH 4/6] Update go.yml --- .github/workflows/go.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 068052d..7f821f0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,6 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - name: Set up Go 1.x uses: actions/setup-go@v2 with: @@ -25,11 +24,32 @@ jobs: - name: Test run: make test - - name: Bench - run: make bench | tee bench-output.txt - - - name: Store benchmark result - uses: rhysd/github-action-benchmark@v1 - with: - tool: 'go' - output-file-path: bench-output.txt + benchmark: + name: Performance regression check + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Run benchmark + run: go test -bench 'Benchmark' | tee output.txt + + - name: Download previous benchmark data + uses: actions/cache@v1 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + + - name: Store benchmark result + uses: rhysd/github-action-benchmark@v1 + with: + tool: 'go' + output-file-path: output.txt + external-data-json-path: ./cache/benchmark-data.json + fail-on-alert: true From ac468f43fcd58265ed0b27b883134d21dc80d574 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 21:55:03 +0200 Subject: [PATCH 5/6] Update go.yml --- .github/workflows/go.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7f821f0..ef80b84 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -53,3 +53,5 @@ jobs: output-file-path: output.txt external-data-json-path: ./cache/benchmark-data.json fail-on-alert: true + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-on-alert: true From c23d941297fb9b3240b11f6888a5a737e026fc8e Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 1 Oct 2020 22:01:28 +0200 Subject: [PATCH 6/6] Update go.yml --- .github/workflows/go.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ef80b84..5a5b725 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -47,7 +47,10 @@ jobs: key: ${{ runner.os }}-benchmark - name: Store benchmark result - uses: rhysd/github-action-benchmark@v1 + # uses: rhysd/github-action-benchmark@v1 + # Support go tabled benchmarks + # Waiting for https://github.com/rhysd/github-action-benchmark/pull/32 + uses: kaancfidan/github-action-benchmark@fix/go-tabled-benchmarks with: tool: 'go' output-file-path: output.txt