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
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ci.yaml 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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: 5
  38. strategy:
  39. matrix:
  40. go_version:
  41. - ^1.18
  42. steps:
  43. - name: Checkout
  44. uses: actions/checkout@v2
  45. with:
  46. submodules: recursive
  47. - name: Setup Go
  48. uses: actions/setup-go@v2
  49. with:
  50. go-version: ${{ matrix.go_version }}
  51. - name: Cache dependencies
  52. uses: actions/cache@v2
  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@v1
  61. with:
  62. file: ./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@v2
  70. with:
  71. submodules: recursive
  72. - name: Setup Go
  73. uses: actions/setup-go@v2
  74. with:
  75. go-version: ^1.18
  76. - name: Cache fuzz results
  77. uses: actions/cache@v2
  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@v2
  97. with:
  98. submodules: recursive
  99. - name: Run linter
  100. uses: golangci/golangci-lint-action@v2
  101. with:
  102. version: v1.44.2
  103. docker:
  104. name: Docker
  105. runs-on: ubuntu-latest
  106. timeout-minutes: 20
  107. steps:
  108. - name: Checkout
  109. uses: actions/checkout@v2
  110. with:
  111. submodules: recursive
  112. - name: Get Docker meta
  113. id: docker_meta
  114. uses: crazy-max/ghaction-docker-meta@v1
  115. with:
  116. images: nineseconds/mtg,ghcr.io/9seconds/mtg
  117. tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
  118. - name: Setup QEMU
  119. uses: docker/setup-qemu-action@v1
  120. - name: Setup BuildX
  121. uses: docker/setup-buildx-action@v1
  122. - name: Setup cache
  123. uses: actions/cache@v2
  124. with:
  125. path: /tmp/buildx-cache
  126. key: ${{ runner.os }}-buildx-${{ github.sha }}
  127. restore-keys: |
  128. ${{ runner.os }}-buildx-
  129. - name: Login to DockerHub
  130. if: github.event_name != 'pull_request'
  131. uses: docker/login-action@v1
  132. with:
  133. username: ${{ secrets.DOCKERHUB_USERNAME }}
  134. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  135. - name: Login to GHCR.io
  136. if: github.event_name != 'pull_request'
  137. uses: docker/login-action@v1
  138. with:
  139. registry: ghcr.io
  140. username: ${{ github.repository_owner }}
  141. password: ${{ secrets.GH_PAT }}
  142. - name: Build and push
  143. uses: docker/build-push-action@v2
  144. with:
  145. pull: true
  146. context: .
  147. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
  148. push: ${{ github.event_name != 'pull_request' }}
  149. tags: ${{ steps.docker_meta.outputs.tags }}
  150. labels: ${{ steps.docker_meta.outputs.labels }}
  151. cache-from: type=local,src=/tmp/buildx-cache
  152. cache-to: type=local,dest=/tmp/buildx-cache