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.

212 lines
7.4 KiB

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