Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Oct 23, 2024
1 parent a59e0fb commit feb6d54
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ^1.22
go-version: ^1.23
- name: Cache go module
uses: actions/cache@v3
with:
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/debug.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Debug build
name: test

on:
push:
Expand All @@ -16,80 +16,96 @@ on:

jobs:
build:
name: Linux Debug build
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23
- name: Build
run: |
make test
build_go120:
name: Linux Debug build (Go 1.20)
name: Linux (Go 1.20)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ~1.20
continue-on-error: true
- name: Build
run: |
make test
build_go121:
name: Linux Debug build (Go 1.21)
name: Linux (Go 1.21)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ~1.21
continue-on-error: true
- name: Build
run: |
make test
build__windows:
name: Windows Debug build
build_go122:
name: Linux (Go 1.22)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ~1.22
continue-on-error: true
- name: Build
run: |
make test
build_windows:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23
continue-on-error: true
- name: Build
run: |
make test
build_darwin:
name: macOS Debug build
name: macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23
continue-on-error: true
- name: Build
run: |
Expand Down
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ linters:
- govet
- gci
- staticcheck
- paralleltest
- ineffassign

linters-settings:
gci:
Expand All @@ -13,5 +15,6 @@ linters-settings:
- standard
- prefix(github.com/sagernet/)
- default
staticcheck:
go: '1.20'

run:
go: "1.23"
4 changes: 3 additions & 1 deletion transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func TestTransports(t *testing.T) {
client := dns.NewClient(dns.ClientOptions{
Logger: logger.NOP(),
})
addresses, err := client.Lookup(context.Background(), transport, "cloudflare.com", dns.DomainStrategyAsIS)
addresses, err := client.Lookup(context.Background(), transport, "cloudflare.com", dns.QueryOptions{
Strategy: dns.DomainStrategyUseIPv4,
})
require.NoError(t, err)
require.NotEmpty(t, addresses)
})
Expand Down

0 comments on commit feb6d54

Please sign in to comment.