Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ci.yaml 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ---
  2. name: CI
  3. permissions:
  4. actions: read
  5. checks: read
  6. contents: read
  7. deployments: read
  8. issues: read
  9. discussions: read
  10. pull-requests: read
  11. repository-projects: read
  12. security-events: read
  13. statuses: read
  14. on:
  15. push:
  16. tags:
  17. - v*
  18. branches:
  19. - master
  20. - stable
  21. - v1
  22. release:
  23. types:
  24. - published
  25. - released
  26. pull_request:
  27. types:
  28. - opened
  29. - edited
  30. - reopened
  31. - synchronize
  32. - ready_for_review
  33. jobs:
  34. test:
  35. name: Test
  36. runs-on: ubuntu-latest
  37. timeout-minutes: 10
  38. strategy:
  39. matrix:
  40. go_version:
  41. - ^1.25
  42. steps:
  43. - name: Checkout
  44. uses: actions/checkout@v6
  45. with:
  46. submodules: recursive
  47. - name: Setup Go
  48. uses: actions/setup-go@v6
  49. with:
  50. go-version: ${{ matrix.go_version }}
  51. - name: Cache dependencies
  52. uses: actions/cache@v5
  53. with:
  54. path: ~/go/pkg/mod
  55. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  56. restore-keys: ${{ runner.os }}-go-
  57. - name: Run tests
  58. run: go test -coverprofile=./coverage.txt -covermode=atomic -v ./...
  59. - name: Collect coverage
  60. uses: codecov/codecov-action@v5
  61. with:
  62. files: ./coverage.txt
  63. fuzz:
  64. name: Fuzzing
  65. runs-on: ubuntu-latest
  66. timeout-minutes: 20
  67. steps:
  68. - name: Checkout
  69. uses: actions/checkout@v6
  70. with:
  71. submodules: recursive
  72. - name: Setup Go
  73. uses: actions/setup-go@v6
  74. with:
  75. go-version: ^1.25
  76. - name: Cache fuzz results
  77. uses: actions/cache@v5
  78. with:
  79. path: ~/.cache/go-build/fuzz
  80. key: ${{ runner.os }}-go-${{ hashFiles('**/*_fuzz_test.go', '**/*_fuzz_internal_test.go') }}
  81. restore-keys: ${{ runner.os }}-go-
  82. - name: Cache dependencies
  83. uses: actions/cache@v2
  84. with:
  85. path: ~/go/pkg/mod
  86. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  87. restore-keys: ${{ runner.os }}-go-
  88. - name: Run fuzzing
  89. run: make -j4 fuzz
  90. lint:
  91. name: Lint
  92. runs-on: ubuntu-latest
  93. timeout-minutes: 5
  94. steps:
  95. - name: Checkout
  96. uses: actions/checkout@v6
  97. with:
  98. submodules: recursive
  99. - name: Setup Go
  100. uses: actions/setup-go@v6
  101. with:
  102. go-version: ^1.25
  103. - name: Run linter
  104. uses: golangci/golangci-lint-action@v3
  105. with:
  106. version: v2.9.0
  107. docker:
  108. name: Docker
  109. runs-on: ubuntu-latest
  110. timeout-minutes: 20
  111. steps:
  112. - name: Checkout
  113. uses: actions/checkout@v6
  114. with:
  115. submodules: recursive
  116. - name: Get Docker meta
  117. id: docker_meta
  118. uses: crazy-max/ghaction-docker-meta@v1
  119. with:
  120. images: nineseconds/mtg,ghcr.io/9seconds/mtg
  121. tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
  122. - name: Setup QEMU
  123. uses: docker/setup-qemu-action@v1
  124. - name: Setup BuildX
  125. uses: docker/setup-buildx-action@v1
  126. - name: Setup cache
  127. uses: actions/cache@v5
  128. with:
  129. path: /tmp/buildx-cache
  130. key: ${{ runner.os }}-buildx-${{ github.sha }}
  131. restore-keys: |
  132. ${{ runner.os }}-buildx-
  133. - name: Login to DockerHub
  134. if: github.event_name != 'pull_request'
  135. uses: docker/login-action@v1
  136. with:
  137. username: ${{ secrets.DOCKERHUB_USERNAME }}
  138. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  139. - name: Login to GHCR.io
  140. if: github.event_name != 'pull_request'
  141. uses: docker/login-action@v1
  142. with:
  143. registry: ghcr.io
  144. username: ${{ github.repository_owner }}
  145. password: ${{ secrets.GH_PAT }}
  146. - name: Build and push
  147. uses: docker/build-push-action@v2
  148. with:
  149. pull: true
  150. context: .
  151. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
  152. push: ${{ github.event_name != 'pull_request' }}
  153. tags: ${{ steps.docker_meta.outputs.tags }}
  154. labels: ${{ steps.docker_meta.outputs.labels }}
  155. cache-from: type=local,src=/tmp/buildx-cache
  156. cache-to: type=local,dest=/tmp/buildx-cache