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
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ci.yaml 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.17
  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. lint:
  64. name: Lint
  65. runs-on: ubuntu-latest
  66. timeout-minutes: 5
  67. steps:
  68. - name: Checkout
  69. uses: actions/checkout@v2
  70. with:
  71. submodules: recursive
  72. - name: Run linter
  73. uses: golangci/golangci-lint-action@v2
  74. with:
  75. version: v1.44.2
  76. docker:
  77. name: Docker
  78. runs-on: ubuntu-latest
  79. timeout-minutes: 20
  80. steps:
  81. - name: Checkout
  82. uses: actions/checkout@v2
  83. with:
  84. submodules: recursive
  85. - name: Get Docker meta
  86. id: docker_meta
  87. uses: crazy-max/ghaction-docker-meta@v1
  88. with:
  89. images: nineseconds/mtg,ghcr.io/9seconds/mtg
  90. tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
  91. - name: Setup QEMU
  92. uses: docker/setup-qemu-action@v1
  93. - name: Setup BuildX
  94. uses: docker/setup-buildx-action@v1
  95. - name: Setup cache
  96. uses: actions/cache@v2
  97. with:
  98. path: /tmp/buildx-cache
  99. key: ${{ runner.os }}-buildx-${{ github.sha }}
  100. restore-keys: |
  101. ${{ runner.os }}-buildx-
  102. - name: Login to DockerHub
  103. if: github.event_name != 'pull_request'
  104. uses: docker/login-action@v1
  105. with:
  106. username: ${{ secrets.DOCKERHUB_USERNAME }}
  107. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  108. - name: Login to GHCR.io
  109. if: github.event_name != 'pull_request'
  110. uses: docker/login-action@v1
  111. with:
  112. registry: ghcr.io
  113. username: ${{ github.repository_owner }}
  114. password: ${{ secrets.GH_PAT }}
  115. - name: Build and push
  116. uses: docker/build-push-action@v2
  117. with:
  118. pull: true
  119. context: .
  120. platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
  121. push: ${{ github.event_name != 'pull_request' }}
  122. tags: ${{ steps.docker_meta.outputs.tags }}
  123. labels: ${{ steps.docker_meta.outputs.labels }}
  124. cache-from: type=local,src=/tmp/buildx-cache
  125. cache-to: type=local,dest=/tmp/buildx-cache