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.

423 lines
15 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 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.repository_owner}}" != "acmesh-official" ]; 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_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  49. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  50. CASE: le_test_dnsapi
  51. TEST_LOCAL: 1
  52. DEBUG: ${{ secrets.DEBUG }}
  53. http_proxy: ${{ secrets.http_proxy }}
  54. https_proxy: ${{ secrets.https_proxy }}
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: Clone acmetest
  58. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  59. - name: Set env file
  60. run: |
  61. cd ../acmetest
  62. if [ "${{ secrets.TokenName1}}" ] ; then
  63. echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env
  64. fi
  65. if [ "${{ secrets.TokenName2}}" ] ; then
  66. echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env
  67. fi
  68. if [ "${{ secrets.TokenName3}}" ] ; then
  69. echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env
  70. fi
  71. if [ "${{ secrets.TokenName4}}" ] ; then
  72. echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env
  73. fi
  74. if [ "${{ secrets.TokenName5}}" ] ; then
  75. echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env
  76. fi
  77. echo "TEST_DNS_NO_WILDCARD" >> docker.env
  78. echo "http_proxy" >> docker.env
  79. echo "https_proxy" >> docker.env
  80. - name: Run acmetest
  81. run: cd ../acmetest && ./rundocker.sh testall
  82. MacOS:
  83. runs-on: macos-latest
  84. needs: Docker
  85. env:
  86. TEST_DNS : ${{ secrets.TEST_DNS }}
  87. TestingDomain: ${{ secrets.TestingDomain }}
  88. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  89. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  90. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  91. CASE: le_test_dnsapi
  92. TEST_LOCAL: 1
  93. DEBUG: ${{ secrets.DEBUG }}
  94. http_proxy: ${{ secrets.http_proxy }}
  95. https_proxy: ${{ secrets.https_proxy }}
  96. steps:
  97. - uses: actions/checkout@v2
  98. - name: Install tools
  99. run: brew install socat
  100. - name: Clone acmetest
  101. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  102. - name: Run acmetest
  103. run: |
  104. if [ "${{ secrets.TokenName1}}" ] ; then
  105. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  106. fi
  107. if [ "${{ secrets.TokenName2}}" ] ; then
  108. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  109. fi
  110. if [ "${{ secrets.TokenName3}}" ] ; then
  111. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  112. fi
  113. if [ "${{ secrets.TokenName4}}" ] ; then
  114. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  115. fi
  116. if [ "${{ secrets.TokenName5}}" ] ; then
  117. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  118. fi
  119. cd ../acmetest
  120. ./letest.sh
  121. Windows:
  122. runs-on: windows-latest
  123. needs: MacOS
  124. env:
  125. TEST_DNS : ${{ secrets.TEST_DNS }}
  126. TestingDomain: ${{ secrets.TestingDomain }}
  127. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  128. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  129. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  130. CASE: le_test_dnsapi
  131. TEST_LOCAL: 1
  132. DEBUG: ${{ secrets.DEBUG }}
  133. http_proxy: ${{ secrets.http_proxy }}
  134. https_proxy: ${{ secrets.https_proxy }}
  135. steps:
  136. - name: Set git to use LF
  137. run: |
  138. git config --global core.autocrlf false
  139. - uses: actions/checkout@v2
  140. - name: Install cygwin base packages with chocolatey
  141. run: |
  142. choco config get cacheLocation
  143. choco install --no-progress cygwin
  144. shell: cmd
  145. - name: Install cygwin additional packages
  146. run: |
  147. C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
  148. shell: cmd
  149. - name: Set ENV
  150. shell: cmd
  151. run: |
  152. echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV%
  153. - name: Clone acmetest
  154. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  155. - name: Run acmetest
  156. shell: bash
  157. run: |
  158. if [ "${{ secrets.TokenName1}}" ] ; then
  159. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  160. fi
  161. if [ "${{ secrets.TokenName2}}" ] ; then
  162. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  163. fi
  164. if [ "${{ secrets.TokenName3}}" ] ; then
  165. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  166. fi
  167. if [ "${{ secrets.TokenName4}}" ] ; then
  168. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  169. fi
  170. if [ "${{ secrets.TokenName5}}" ] ; then
  171. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  172. fi
  173. cd ../acmetest
  174. ./letest.sh
  175. FreeBSD:
  176. runs-on: macos-12
  177. needs: Windows
  178. env:
  179. TEST_DNS : ${{ secrets.TEST_DNS }}
  180. TestingDomain: ${{ secrets.TestingDomain }}
  181. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  182. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  183. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  184. CASE: le_test_dnsapi
  185. TEST_LOCAL: 1
  186. DEBUG: ${{ secrets.DEBUG }}
  187. http_proxy: ${{ secrets.http_proxy }}
  188. https_proxy: ${{ secrets.https_proxy }}
  189. steps:
  190. - uses: actions/checkout@v2
  191. - name: Clone acmetest
  192. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  193. - uses: vmactions/freebsd-vm@v0
  194. with:
  195. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  196. prepare: pkg install -y socat curl
  197. usesh: true
  198. copyback: false
  199. run: |
  200. if [ "${{ secrets.TokenName1}}" ] ; then
  201. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  202. fi
  203. if [ "${{ secrets.TokenName2}}" ] ; then
  204. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  205. fi
  206. if [ "${{ secrets.TokenName3}}" ] ; then
  207. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  208. fi
  209. if [ "${{ secrets.TokenName4}}" ] ; then
  210. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  211. fi
  212. if [ "${{ secrets.TokenName5}}" ] ; then
  213. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  214. fi
  215. cd ../acmetest
  216. ./letest.sh
  217. Solaris:
  218. runs-on: macos-12
  219. needs: FreeBSD
  220. env:
  221. TEST_DNS : ${{ secrets.TEST_DNS }}
  222. TestingDomain: ${{ secrets.TestingDomain }}
  223. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  224. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  225. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  226. CASE: le_test_dnsapi
  227. TEST_LOCAL: 1
  228. DEBUG: ${{ secrets.DEBUG }}
  229. http_proxy: ${{ secrets.http_proxy }}
  230. https_proxy: ${{ secrets.https_proxy }}
  231. steps:
  232. - uses: actions/checkout@v2
  233. - name: Clone acmetest
  234. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  235. - uses: vmactions/solaris-vm@v0
  236. with:
  237. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  238. copyback: false
  239. prepare: pkgutil -y -i socat
  240. run: |
  241. pkg set-mediator -v -I default@1.1 openssl
  242. export PATH=/usr/gnu/bin:$PATH
  243. if [ "${{ secrets.TokenName1}}" ] ; then
  244. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  245. fi
  246. if [ "${{ secrets.TokenName2}}" ] ; then
  247. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  248. fi
  249. if [ "${{ secrets.TokenName3}}" ] ; then
  250. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  251. fi
  252. if [ "${{ secrets.TokenName4}}" ] ; then
  253. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  254. fi
  255. if [ "${{ secrets.TokenName5}}" ] ; then
  256. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  257. fi
  258. cd ../acmetest
  259. ./letest.sh
  260. OpenBSD:
  261. runs-on: macos-12
  262. needs: Solaris
  263. env:
  264. TEST_DNS : ${{ secrets.TEST_DNS }}
  265. TestingDomain: ${{ secrets.TestingDomain }}
  266. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  267. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  268. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  269. CASE: le_test_dnsapi
  270. TEST_LOCAL: 1
  271. DEBUG: ${{ secrets.DEBUG }}
  272. http_proxy: ${{ secrets.http_proxy }}
  273. https_proxy: ${{ secrets.https_proxy }}
  274. steps:
  275. - uses: actions/checkout@v2
  276. - name: Clone acmetest
  277. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  278. - uses: vmactions/openbsd-vm@v0
  279. with:
  280. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  281. prepare: pkg_add socat curl
  282. usesh: true
  283. copyback: false
  284. run: |
  285. if [ "${{ secrets.TokenName1}}" ] ; then
  286. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  287. fi
  288. if [ "${{ secrets.TokenName2}}" ] ; then
  289. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  290. fi
  291. if [ "${{ secrets.TokenName3}}" ] ; then
  292. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  293. fi
  294. if [ "${{ secrets.TokenName4}}" ] ; then
  295. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  296. fi
  297. if [ "${{ secrets.TokenName5}}" ] ; then
  298. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  299. fi
  300. cd ../acmetest
  301. ./letest.sh
  302. NetBSD:
  303. runs-on: macos-12
  304. needs: OpenBSD
  305. env:
  306. TEST_DNS : ${{ secrets.TEST_DNS }}
  307. TestingDomain: ${{ secrets.TestingDomain }}
  308. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  309. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  310. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  311. CASE: le_test_dnsapi
  312. TEST_LOCAL: 1
  313. DEBUG: ${{ secrets.DEBUG }}
  314. http_proxy: ${{ secrets.http_proxy }}
  315. https_proxy: ${{ secrets.https_proxy }}
  316. steps:
  317. - uses: actions/checkout@v2
  318. - name: Clone acmetest
  319. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  320. - uses: vmactions/netbsd-vm@v0
  321. with:
  322. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  323. prepare: |
  324. pkg_add curl socat
  325. usesh: true
  326. copyback: false
  327. run: |
  328. if [ "${{ secrets.TokenName1}}" ] ; then
  329. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  330. fi
  331. if [ "${{ secrets.TokenName2}}" ] ; then
  332. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  333. fi
  334. if [ "${{ secrets.TokenName3}}" ] ; then
  335. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  336. fi
  337. if [ "${{ secrets.TokenName4}}" ] ; then
  338. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  339. fi
  340. if [ "${{ secrets.TokenName5}}" ] ; then
  341. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  342. fi
  343. cd ../acmetest
  344. ./letest.sh
  345. DragonFlyBSD:
  346. runs-on: macos-12
  347. needs: NetBSD
  348. env:
  349. TEST_DNS : ${{ secrets.TEST_DNS }}
  350. TestingDomain: ${{ secrets.TestingDomain }}
  351. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  352. TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
  353. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  354. CASE: le_test_dnsapi
  355. TEST_LOCAL: 1
  356. DEBUG: ${{ secrets.DEBUG }}
  357. http_proxy: ${{ secrets.http_proxy }}
  358. https_proxy: ${{ secrets.https_proxy }}
  359. steps:
  360. - uses: actions/checkout@v2
  361. - name: Clone acmetest
  362. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  363. - uses: vmactions/dragonflybsd-vm@v0
  364. with:
  365. envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
  366. prepare: |
  367. pkg install -y curl socat
  368. usesh: true
  369. copyback: false
  370. run: |
  371. if [ "${{ secrets.TokenName1}}" ] ; then
  372. export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
  373. fi
  374. if [ "${{ secrets.TokenName2}}" ] ; then
  375. export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
  376. fi
  377. if [ "${{ secrets.TokenName3}}" ] ; then
  378. export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
  379. fi
  380. if [ "${{ secrets.TokenName4}}" ] ; then
  381. export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
  382. fi
  383. if [ "${{ secrets.TokenName5}}" ] ; then
  384. export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
  385. fi
  386. cd ../acmetest
  387. ./letest.sh