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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ci.yaml 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v6
  41. with:
  42. submodules: recursive
  43. - uses: jdx/mise-action@v3
  44. name: Install mise
  45. - name: Cache Go modules and build
  46. uses: actions/cache@v5
  47. with:
  48. path: |
  49. ~/go/pkg/mod
  50. ~/.cache/go-build
  51. key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
  52. restore-keys: |
  53. ${{ runner.os }}-go-
  54. - name: Run tests
  55. run: mise tasks run covtest
  56. - name: Collect coverage
  57. uses: codecov/codecov-action@v5
  58. with:
  59. files: ./coverage.txt
  60. fuzz:
  61. name: Fuzzing
  62. runs-on: ubuntu-latest
  63. timeout-minutes: 20
  64. steps:
  65. - name: Checkout
  66. uses: actions/checkout@v6
  67. with:
  68. submodules: recursive
  69. - uses: jdx/mise-action@v3
  70. name: Install mise
  71. - name: Cache Go modules and build
  72. uses: actions/cache@v5
  73. with:
  74. path: |
  75. ~/go/pkg/mod
  76. ~/.cache/go-build
  77. key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
  78. restore-keys: |
  79. ${{ runner.os }}-go-
  80. - name: Run fuzzing
  81. run: mise tasks run 'test:fuzz:*'
  82. lint:
  83. name: Lint
  84. runs-on: ubuntu-latest
  85. timeout-minutes: 5
  86. steps:
  87. - name: Checkout
  88. uses: actions/checkout@v6
  89. with:
  90. submodules: recursive
  91. - uses: jdx/mise-action@v3
  92. name: Install mise
  93. - name: Cache Go modules and build
  94. uses: actions/cache@v5
  95. with:
  96. path: |
  97. ~/go/pkg/mod
  98. ~/.cache/go-build
  99. key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
  100. restore-keys: |
  101. ${{ runner.os }}-go-
  102. - name: Run linter
  103. run: mise tasks run lint
  104. docker:
  105. name: Docker
  106. runs-on: ubuntu-latest
  107. timeout-minutes: 20
  108. permissions:
  109. contents: read
  110. packages: write
  111. steps:
  112. - name: Checkout
  113. uses: actions/checkout@v6
  114. with:
  115. submodules: recursive
  116. - name: Get Docker meta
  117. id: meta
  118. uses: docker/metadata-action@v5
  119. with:
  120. images: |
  121. nineseconds/mtg
  122. ghcr.io/${{ github.repository }}
  123. tags: |
  124. type=semver,pattern={{version}}
  125. type=semver,pattern={{major}}.{{minor}}
  126. type=semver,pattern={{major}}
  127. type=raw,value=latest,enable={{is_default_branch}}
  128. type=raw,value=master,enable=${{ github.ref == 'refs/heads/master' }}
  129. type=raw,value=stable,enable=${{ github.ref == 'refs/heads/stable' }}
  130. - name: Setup QEMU
  131. uses: docker/setup-qemu-action@v3
  132. - name: Setup BuildX
  133. uses: docker/setup-buildx-action@v3
  134. - name: Login to DockerHub
  135. if: github.event_name != 'pull_request'
  136. uses: docker/login-action@v3
  137. with:
  138. username: ${{ secrets.DOCKERHUB_USERNAME }}
  139. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  140. - name: Login to GitHub Container Registry
  141. if: github.event_name != 'pull_request'
  142. uses: docker/login-action@v3
  143. with:
  144. registry: ghcr.io
  145. username: ${{ github.actor }}
  146. password: ${{ secrets.GITHUB_TOKEN }}
  147. - name: Build and push
  148. uses: docker/build-push-action@v6
  149. with:
  150. pull: true
  151. context: .
  152. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
  153. push: ${{ github.event_name != 'pull_request' }}
  154. tags: ${{ steps.meta.outputs.tags }}
  155. labels: ${{ steps.meta.outputs.labels }}
  156. cache-from: type=gha
  157. cache-to: type=gha,mode=max