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.

171 lines
5.8 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
  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 "Plese see this page to fix the error: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
  37. - name: Fail
  38. if: "github.actor != 'Neilpang'"
  39. run: false
  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 update && 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. run: |
  141. echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
  142. - name: Clone acmetest
  143. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  144. - name: Run acmetest
  145. shell: bash
  146. run: |
  147. if [ "${{ secrets.TokenName1}}" ] ; then
  148. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  149. fi
  150. if [ "${{ secrets.TokenName2}}" ] ; then
  151. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  152. fi
  153. if [ "${{ secrets.TokenName3}}" ] ; then
  154. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  155. fi
  156. if [ "${{ secrets.TokenName4}}" ] ; then
  157. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  158. fi
  159. if [ "${{ secrets.TokenName5}}" ] ; then
  160. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  161. fi
  162. cd ../acmetest
  163. ./letest.sh