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.

211 lines
7.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. name: DNS
  2. on:
  3. push:
  4. branches:
  5. - 'dev'
  6. paths:
  7. - 'dnsapi/*.sh'
  8. - '.github/workflows/DNS.yml'
  9. pull_request:
  10. branches:
  11. - 'dev'
  12. paths:
  13. - 'dnsapi/*.sh'
  14. - '.github/workflows/DNS.yml'
  15. jobs:
  16. CheckToken:
  17. runs-on: ubuntu-latest
  18. outputs:
  19. hasToken: ${{ steps.step_one.outputs.hasToken }}
  20. steps:
  21. - name: Set the value
  22. id: step_one
  23. run: |
  24. if [ "${{secrets.TokenName1}}" ] ; then
  25. echo "::set-output name=hasToken::true"
  26. else
  27. echo "::set-output name=hasToken::false"
  28. fi
  29. - name: Check the value
  30. run: echo ${{ steps.step_one.outputs.hasToken }}
  31. Fail:
  32. runs-on: ubuntu-latest
  33. needs: CheckToken
  34. if: "contains(needs.CheckToken.outputs.hasToken, 'false')"
  35. steps:
  36. - name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
  37. run: |
  38. echo "Plese see this page to fix the error: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
  39. - name: Fail
  40. if: "github.actor != 'Neilpang'"
  41. run: false
  42. Docker:
  43. runs-on: ubuntu-latest
  44. needs: CheckToken
  45. if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
  46. env:
  47. TEST_DNS : ${{ secrets.TEST_DNS }}
  48. TestingDomain: ${{ secrets.TestingDomain }}
  49. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  50. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  51. CASE: le_test_dnsapi
  52. TEST_LOCAL: 1
  53. DEBUG: 1
  54. steps:
  55. - uses: actions/checkout@v2
  56. - name: Clone acmetest
  57. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  58. - name: Set env file
  59. run: |
  60. cd ../acmetest
  61. if [ "${{ secrets.TokenName1}}" ] ; then
  62. echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> env.list
  63. fi
  64. if [ "${{ secrets.TokenName2}}" ] ; then
  65. echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> env.list
  66. fi
  67. if [ "${{ secrets.TokenName3}}" ] ; then
  68. echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> env.list
  69. fi
  70. if [ "${{ secrets.TokenName4}}" ] ; then
  71. echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> env.list
  72. fi
  73. if [ "${{ secrets.TokenName5}}" ] ; then
  74. echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> env.list
  75. fi
  76. echo "TEST_DNS_NO_WILDCARD" >> env.list
  77. echo "TEST_DNS_SLEEP" >> env.list
  78. - name: Run acmetest
  79. run: cd ../acmetest && ./rundocker.sh testall
  80. MacOS:
  81. runs-on: macos-latest
  82. needs: Docker
  83. env:
  84. TEST_DNS : ${{ secrets.TEST_DNS }}
  85. TestingDomain: ${{ secrets.TestingDomain }}
  86. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  87. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  88. CASE: le_test_dnsapi
  89. TEST_LOCAL: 1
  90. DEBUG: 1
  91. steps:
  92. - uses: actions/checkout@v2
  93. - name: Install tools
  94. run: brew install socat
  95. - name: Clone acmetest
  96. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  97. - name: Run acmetest
  98. run: |
  99. if [ "${{ secrets.TokenName1}}" ] ; then
  100. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  101. fi
  102. if [ "${{ secrets.TokenName2}}" ] ; then
  103. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  104. fi
  105. if [ "${{ secrets.TokenName3}}" ] ; then
  106. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  107. fi
  108. if [ "${{ secrets.TokenName4}}" ] ; then
  109. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  110. fi
  111. if [ "${{ secrets.TokenName5}}" ] ; then
  112. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  113. fi
  114. cd ../acmetest
  115. ./letest.sh
  116. Windows:
  117. runs-on: windows-latest
  118. needs: MacOS
  119. env:
  120. TEST_DNS : ${{ secrets.TEST_DNS }}
  121. TestingDomain: ${{ secrets.TestingDomain }}
  122. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  123. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  124. CASE: le_test_dnsapi
  125. TEST_LOCAL: 1
  126. DEBUG: 1
  127. steps:
  128. - name: Set git to use LF
  129. run: |
  130. git config --global core.autocrlf false
  131. - uses: actions/checkout@v2
  132. - name: Install cygwin base packages with chocolatey
  133. run: |
  134. choco config get cacheLocation
  135. choco install --no-progress cygwin
  136. shell: cmd
  137. - name: Install cygwin additional packages
  138. run: |
  139. C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
  140. shell: cmd
  141. - name: Set ENV
  142. shell: cmd
  143. run: |
  144. echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV%
  145. - name: Clone acmetest
  146. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  147. - name: Run acmetest
  148. shell: cmd
  149. run: |
  150. if [ "${{ secrets.TokenName1}}" ] ; then
  151. set ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  152. fi
  153. if [ "${{ secrets.TokenName2}}" ] ; then
  154. set ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  155. fi
  156. if [ "${{ secrets.TokenName3}}" ] ; then
  157. set ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  158. fi
  159. if [ "${{ secrets.TokenName4}}" ] ; then
  160. set ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  161. fi
  162. if [ "${{ secrets.TokenName5}}" ] ; then
  163. set ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  164. fi
  165. cd ../acmetest
  166. bash.exe -c ./letest.sh
  167. Solaris:
  168. runs-on: macos-latest
  169. needs: FreeBSD
  170. env:
  171. TEST_DNS : ${{ secrets.TEST_DNS }}
  172. TestingDomain: ${{ secrets.TestingDomain }}
  173. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  174. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  175. CASE: le_test_dnsapi
  176. TEST_LOCAL: 1
  177. DEBUG: 1
  178. steps:
  179. - uses: actions/checkout@v2
  180. - name: Clone acmetest
  181. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  182. - uses: vmactions/solaris-vm@v0.0.1
  183. with:
  184. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  185. prepare: pkgutil -y -i socat curl
  186. run: |
  187. if [ "${{ secrets.TokenName1}}" ] ; then
  188. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  189. fi
  190. if [ "${{ secrets.TokenName2}}" ] ; then
  191. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  192. fi
  193. if [ "${{ secrets.TokenName3}}" ] ; then
  194. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  195. fi
  196. if [ "${{ secrets.TokenName4}}" ] ; then
  197. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  198. fi
  199. if [ "${{ secrets.TokenName5}}" ] ; then
  200. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  201. fi
  202. cd ../acmetest
  203. ./letest.sh