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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ci.yaml 3.1KB

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