Skip to content

Commit

Permalink
update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyenought committed Nov 17, 2023
1 parent f98ff90 commit 0b0f5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 100 deletions.
97 changes: 0 additions & 97 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@ name: Tests
on: [push, pull_request]

jobs:
compat-test:
strategy:
matrix:
version: ["1.16", "1.17"]
runs-on: [self-hosted, X64]
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

# Just build tests without running them
- name: Build Test
run: go test -run=nope ./...

lint-and-ut:
strategy:
matrix:
Expand All @@ -42,83 +25,3 @@ jobs:
- name: Unit Test
run: go test -race -covermode=atomic -coverprofile=coverage.txt ./...

- name: Codecov
run: bash <(curl -s https://codecov.io/bash)

ut-windows:
strategy:
matrix:
version: ["1.18", "1.19", "1.20"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Unit Test
run: go test -race -covermode=atomic ./...

hz-test-unix:
strategy:
matrix:
version: [ '1.20' ]
runs-on: [ self-hosted, X64 ]
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35

- name: Hz Test
if: contains(steps.changed-files.outputs.all_changed_files, 'cmd/hz')
run: |
cd cmd/hz
sh test_hz_unix.sh
hz-test-windows:
strategy:
matrix:
version: [ '1.20']
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35

- name: Install Protobuf
shell: pwsh
run: |
Invoke-WebRequest https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win64.zip -OutFile protoc-3.19.4-win64.zip
Expand-Archive protoc-3.19.4-win64.zip -DestinationPath protoc-3.19.4-win64
$GOPATH=go env GOPATH
Copy-Item -Path protoc-3.19.4-win64\bin\protoc.exe -Destination $GOPATH\bin
Copy-Item -Path protoc-3.19.4-win64\include\* -Destination cmd\hz\testdata\include\google -Recurse
protoc --version
- name: Hz Test
if: contains(steps.changed-files.outputs.all_changed_files, 'cmd/hz')
run: |
cd cmd/hz
sh test_hz_windows.sh
6 changes: 3 additions & 3 deletions pkg/route/routes_timing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ func BenchmarkTree_FindAnyFallback(b *testing.B) {
func BenchmarkRouteStatic(b *testing.B) {
cfg := []config.Option{
{
func(o *config.Options) {
F: func(o *config.Options) {
o.DisablePrintRoute = true
},
},
Expand All @@ -641,7 +641,7 @@ func BenchmarkRouteStatic(b *testing.B) {
func BenchmarkRouteParam(b *testing.B) {
cfg := []config.Option{
{
func(o *config.Options) {
F: func(o *config.Options) {
o.DisablePrintRoute = true
},
},
Expand All @@ -661,7 +661,7 @@ func BenchmarkRouteParam(b *testing.B) {
func BenchmarkRouteAny(b *testing.B) {
cfg := []config.Option{
{
func(o *config.Options) {
F: func(o *config.Options) {
o.DisablePrintRoute = true
},
},
Expand Down

0 comments on commit 0b0f5d3

Please sign in to comment.