From 279ad4f3a0a8a067b38d3d0a88e0a9ae906b72f2 Mon Sep 17 00:00:00 2001 From: fy Date: Tue, 14 May 2024 21:14:34 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BB=8E=E8=87=AA=E5=8A=A8=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=B8=AD=E7=A7=BB=E9=99=A4=E4=BA=86-race=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0go=E5=86=85=E9=83=A8=E8=B0=83=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E9=9D=9E=E5=B8=B8=E7=9A=84=E6=85=A2(?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=98=AFunicode=E7=9B=B8=E5=85=B3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test_and_lint.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_lint.yml b/.github/workflows/test_and_lint.yml index f24447ba..5ece1a7b 100644 --- a/.github/workflows/test_and_lint.yml +++ b/.github/workflows/test_and_lint.yml @@ -17,7 +17,20 @@ jobs: - run: go mod tidy - run: go get - run: go generate ./... - - run: go test -v -race -cover ./... + - run: go test -v -cover ./... + + # https://blog.jetbrains.com/go/2019/04/03/profiling-go-applications-and-tests/ + - run: go test -v -bench=^BenchmarkInBoundsChannels$ -cpuprofile=cpu.out -memprofile mem.out . + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: cpu-profile + path: ./cpu.out + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: mem-profile + path: ./mem.out lint: runs-on: ubuntu-latest