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
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ---
  2. name: CI
  3. on:
  4. push:
  5. tags:
  6. - v*
  7. branches:
  8. - master
  9. - stable
  10. - v1
  11. release:
  12. types:
  13. - published
  14. - released
  15. pull_request:
  16. types:
  17. - opened
  18. - edited
  19. - reopened
  20. - synchronize
  21. - ready_for_review
  22. jobs:
  23. test:
  24. name: Test
  25. runs-on: ubuntu-latest
  26. timeout-minutes: 5
  27. strategy:
  28. matrix:
  29. go_version:
  30. - ~1.16
  31. - ^1.17
  32. steps:
  33. - name: Checkout
  34. uses: actions/checkout@v2
  35. with:
  36. submodules: recursive
  37. - name: Setup Go
  38. uses: actions/setup-go@v2
  39. with:
  40. go-version: ${{ matrix.go_version }}
  41. - name: Cache dependencies
  42. uses: actions/cache@v2
  43. with:
  44. path: ~/go/pkg/mod
  45. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  46. restore-keys: ${{ runner.os }}-go-
  47. - name: Run tests
  48. run: go test -coverprofile=./coverage.txt -covermode=atomic -v ./...
  49. - name: Collect coverage
  50. uses: codecov/codecov-action@v1
  51. with:
  52. file: ./coverage.txt
  53. lint:
  54. name: Lint
  55. runs-on: ubuntu-latest
  56. timeout-minutes: 5
  57. steps:
  58. - name: Checkout
  59. uses: actions/checkout@v2
  60. with:
  61. submodules: recursive
  62. - name: Run linter
  63. uses: golangci/golangci-lint-action@v2
  64. with:
  65. version: v1.42.0
  66. docker:
  67. name: Docker
  68. runs-on: ubuntu-latest
  69. timeout-minutes: 20
  70. steps:
  71. - name: Checkout
  72. uses: actions/checkout@v2
  73. with:
  74. submodules: recursive
  75. - name: Get Docker meta
  76. id: docker_meta
  77. uses: crazy-max/ghaction-docker-meta@v1
  78. with:
  79. images: nineseconds/mtg,ghcr.io/9seconds/mtg
  80. tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
  81. - name: Setup QEMU
  82. uses: docker/setup-qemu-action@v1
  83. - name: Setup BuildX
  84. uses: docker/setup-buildx-action@v1
  85. - name: Setup cache
  86. uses: actions/cache@v2
  87. with:
  88. path: /tmp/buildx-cache
  89. key: ${{ runner.os }}-buildx-${{ github.sha }}
  90. restore-keys: |
  91. ${{ runner.os }}-buildx-
  92. - name: Login to DockerHub
  93. if: github.event_name != 'pull_request'
  94. uses: docker/login-action@v1
  95. with:
  96. username: ${{ secrets.DOCKERHUB_USERNAME }}
  97. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  98. - name: Login to GHCR.io
  99. if: github.event_name != 'pull_request'
  100. uses: docker/login-action@v1
  101. with:
  102. registry: ghcr.io
  103. username: ${{ github.repository_owner }}
  104. password: ${{ secrets.GH_PAT }}
  105. - name: Build and push
  106. uses: docker/build-push-action@v2
  107. with:
  108. pull: true
  109. context: .
  110. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
  111. push: ${{ github.event_name != 'pull_request' }}
  112. tags: ${{ steps.docker_meta.outputs.tags }}
  113. labels: ${{ steps.docker_meta.outputs.labels }}
  114. cache-from: type=local,src=/tmp/buildx-cache
  115. cache-to: type=local,dest=/tmp/buildx-cache