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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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