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 символов.

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