forked from mirror/serenity
Add crazy badges to README
This commit is contained in:
parent
d7af8bd589
commit
6ada0cc22e
33
.github/workflows/debug.yml
vendored
33
.github/workflows/debug.yml
vendored
@ -1,33 +0,0 @@
|
||||
name: Debug build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/debug.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Debug build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
continue-on-error: true
|
||||
- name: Run Test
|
||||
run: |
|
||||
go test -v ./...
|
14
.github/workflows/lint.yml
vendored
14
.github/workflows/lint.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Lint
|
||||
name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -20,16 +20,20 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
key: go-${{ hashFiles('**/go.sum') }}
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v4
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: latest
|
||||
args: --timeout=30m
|
||||
install-mode: binary
|
64
.github/workflows/test.yml
vendored
Normal file
64
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/debug.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
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@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
- 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@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
continue-on-error: true
|
||||
- name: Build
|
||||
run: |
|
||||
make test
|
||||
build_darwin:
|
||||
name: macOS
|
||||
runs-on: macos-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
|
@ -5,7 +5,6 @@ linters:
|
||||
- govet
|
||||
- gci
|
||||
- staticcheck
|
||||
- paralleltest
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
@ -14,5 +13,3 @@ linters-settings:
|
||||
- standard
|
||||
- prefix(github.com/sagernet/)
|
||||
- default
|
||||
staticcheck:
|
||||
go: '1.20'
|
||||
|
3
Makefile
3
Makefile
@ -35,6 +35,9 @@ lint:
|
||||
lint_install:
|
||||
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
release:
|
||||
goreleaser release --clean --skip publish
|
||||
mkdir dist/release
|
||||
|
@ -1,5 +1,8 @@
|
||||
# serenity
|
||||
|
||||
![test](https://github.com/sagernet/sing/actions/workflows/test.yml/badge.svg)
|
||||
![lint](https://github.com/sagernet/sing/actions/workflows/lint.yml/badge.svg)
|
||||
|
||||
The configuration generator for sing-box.
|
||||
|
||||
## Documentation
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/sagernet/sing-box/option"
|
||||
"github.com/sagernet/sing/common/json"
|
||||
"github.com/sagernet/sing/common/rw"
|
||||
"github.com/sagernet/sing/common/varbin"
|
||||
)
|
||||
|
||||
type Subscription struct {
|
||||
@ -23,7 +23,7 @@ func (c *Subscription) MarshalBinary() ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = rw.WriteUVariant(&buffer, uint64(len(content)))
|
||||
_, err = varbin.WriteUvarint(&buffer, uint64(len(content)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -35,7 +35,7 @@ func (c *Subscription) MarshalBinary() ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = rw.WriteVString(&buffer, c.LastEtag)
|
||||
err = varbin.Write(&buffer, binary.BigEndian, c.LastEtag)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -49,7 +49,7 @@ func (c *Subscription) UnmarshalBinary(data []byte) error {
|
||||
return err
|
||||
}
|
||||
_ = version
|
||||
contentLength, err := rw.ReadUVariant(reader)
|
||||
contentLength, err := binary.ReadUvarint(reader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -68,7 +68,7 @@ func (c *Subscription) UnmarshalBinary(data []byte) error {
|
||||
return err
|
||||
}
|
||||
c.LastUpdated = time.Unix(lastUpdatedUnix, 0)
|
||||
c.LastEtag, err = rw.ReadVString(reader)
|
||||
err = varbin.Read(reader, binary.BigEndian, &c.LastEtag)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestFilter1100(t *testing.T) {
|
||||
t.Parallel()
|
||||
options := &option.Options{
|
||||
DNS: &option.DNSOptions{
|
||||
Rules: []option.DNSRule{
|
||||
|
Loading…
Reference in New Issue
Block a user