Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ tg/* linguist-vendored
tdapi/* linguist-vendored
tl_*_gen.go linguist-vendored
*.gen.go linguist-vendored
*.tl text eol=lf
*.json text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Get Go environment
id: go-env
run: echo "::set-output name=modcache::$(go env GOMODCACHE)"
run: echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up cache
uses: actions/cache@v6
with:
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ jobs:
strategy:
fail-fast: false
matrix:
flags: [""]
go:
- "oldstable"
- "stable"
arch:
- amd64
runner:
- ubuntu-latest
- macos-latest
# Cover supported Go versions on Linux and portability once per
# non-Linux OS. A Cartesian Go x OS matrix only repeats the generated
# model suite and makes a cold macOS build take over an hour.
include:
- arch: amd64
runner: ubuntu-latest
go: "oldstable"
flags: ""

- arch: amd64
runner: ubuntu-latest
go: "stable"
flags: ""

- arch: amd64
runner: macos-latest
go: "oldstable"
flags: ""

- arch: amd64
runner: windows-latest
go: "stable"
Expand All @@ -44,9 +53,10 @@ jobs:

- name: Get Go environment
id: go-env
shell: bash
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"
echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up cache
uses: actions/cache@v6
with:
Expand All @@ -61,4 +71,4 @@ jobs:
env:
GOARCH: ${{ matrix.arch }}
GOFLAGS: ${{ matrix.flags }}
run: go test --timeout 5m ./...
run: go test --timeout 15m ./...
19 changes: 0 additions & 19 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,3 @@ jobs:
path: profile.out
if-no-files-found: error
retention-days: 1

upload:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Download artifact
uses: actions/download-artifact@v8
with:
name: coverage

- name: Send coverage
uses: codecov/codecov-action@v7
with:
files: profile.out
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# That is, we must not cache e2e test results.
- name: Get Go environment
id: go-env
run: echo "::set-output name=modcache::$(go env GOMODCACHE)"
run: echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up cache
uses: actions/cache@v6
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Get Go environment
id: go-env
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"
echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up cache
uses: actions/cache@v6
with:
Expand Down Expand Up @@ -52,8 +52,8 @@ jobs:
- name: Get Go environment
id: go-env
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"
echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up cache
uses: actions/cache@v6
with:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/nightly.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/update-schema.yml

This file was deleted.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ upstream base becomes the documented baseline only after deterministic
generation, fork tests, downstream `telesrv` validation, and publication of a
new immutable tag.

Fork CI deliberately has no scheduled schema updater and does not upload to the
upstream Codecov project. Coverage is still generated and retained as a workflow
artifact. Schema updates must use the reviewed local import and policy-audit
workflow; they are never opened automatically by a credentialed GitHub Action.

Telegram MTProto API client in Go for users and bots.

[![Telegram: English chat](https://api.go-faster.org/badge/telegram/gotd_en?title=EN&v=1)](https://t.me/gotd_en) [![Telegram: Russian chat](https://api.go-faster.org/badge/telegram/gotd_ru?title=RU&v=1)](https://t.me/gotd_ru) [![Telegram: Chinese chat](https://api.go-faster.org/badge/telegram/gotd_zhcn?title=CN&v=1)](https://t.me/gotd_zhcn) [![Telegram: Online count](https://api.go-faster.org/badge/telegram/online?groups=gotd_ru&groups=gotd_en&groups=gotd_zhcn)](https://t.me/gotd_en)
Expand Down
11 changes: 9 additions & 2 deletions cmd/gotdgen/schema_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,21 @@ func schemaGitLocation(sourcePath string) (root, relative string, err error) {
if err != nil {
return "", "", err
}
root, err = runGit(filepath.Dir(abs), "rev-parse", "--show-toplevel")
sourceDir := filepath.Dir(abs)
root, err = runGit(sourceDir, "rev-parse", "--show-toplevel")
if err != nil {
return "", "", err
}
relative, err = filepath.Rel(root, abs)
// Ask Git for the repository-relative directory instead of combining
// filepath.Abs and Git's canonical root. Those paths can name the same
// directory differently: macOS resolves /var to /private/var, while Windows
// runners may mix long paths with their 8.3 aliases. Git already owns the
// tracked-path identity needed by the provenance check.
prefix, err := runGit(sourceDir, "rev-parse", "--show-prefix")
if err != nil {
return "", "", err
}
relative = filepath.Clean(filepath.Join(filepath.FromSlash(prefix), filepath.Base(abs)))
return root, relative, nil
}

Expand Down
6 changes: 3 additions & 3 deletions telegram/calls/group_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/pion/transport/v4/vnet"
"github.com/pion/webrtc/v4"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
"go.uber.org/zap"

"github.com/gotd/log"
"github.com/gotd/log/logzap"
Expand All @@ -35,7 +35,7 @@ func TestGroupConnJoinPayload(t *testing.T) {
require.NoError(t, router.Start())
defer func() { _ = router.Stop() }()

g := newGroupConn(log.For(logzap.New(zaptest.NewLogger(t))))
g := newGroupConn(log.For(logzap.New(zap.NewNop())))
g.net = nw
defer func() { _ = g.close() }()

Expand Down Expand Up @@ -63,7 +63,7 @@ func TestGroupConnJoinPayload(t *testing.T) {
}

func TestGroupConnFireOnce(t *testing.T) {
g := newGroupConn(log.For(logzap.New(zaptest.NewLogger(t))))
g := newGroupConn(log.For(logzap.New(zap.NewNop())))

connected := 0
g.onConnected = func() { connected++ }
Expand Down
4 changes: 2 additions & 2 deletions telegram/calls/loopback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/pion/transport/v4/vnet"
"github.com/pion/webrtc/v4"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
"go.uber.org/zap"

"github.com/gotd/log"
"github.com/gotd/log/logzap"
Expand Down Expand Up @@ -40,7 +40,7 @@ func TestConnLoopback(t *testing.T) {
require.NoError(t, router.Start())
defer func() { _ = router.Stop() }()

zapLog := zaptest.NewLogger(t)
zapLog := zap.NewNop()
caller := newConn(true, log.For(logzap.New(zapLog.Named("caller"))))
caller.net = callerNet
callee := newConn(false, log.For(logzap.New(zapLog.Named("callee"))))
Expand Down
Loading