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.

132 lines
4.4 KiB

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. env:
  21. _ACME_CHECK_TOKEN_${{ secrets.TokenName1 }} : ${{ secrets.TokenValue1 }}
  22. steps:
  23. - name: Set the value
  24. id: step_one
  25. run: |
  26. if [ "$_ACME_CHECK_TOKEN_${{ secrets.TokenName1}}" ] ; then
  27. echo "::set-output name=hasToken::true"
  28. else
  29. echo "::set-output name=hasToken::false"
  30. fi
  31. - name: Check the value
  32. run: echo ${{ steps.step_one.outputs.hasToken }}
  33. Fail:
  34. runs-on: ubuntu-latest
  35. needs: CheckToken
  36. if: "contains(needs.CheckToken.outputs.hasToken, 'false')"
  37. steps:
  38. - name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
  39. run: |
  40. echo "Plese see this page to fix the error: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
  41. - name: Fail
  42. if: "github.actor != 'Neilpang'"
  43. run: false
  44. Docker:
  45. runs-on: ubuntu-latest
  46. needs: CheckToken
  47. if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
  48. env:
  49. ${{ secrets.TokenName1 }} : ${{ secrets.TokenValue1 }}
  50. ${{ secrets.TokenName2 }} : ${{ secrets.TokenValue2 }}
  51. TEST_DNS : ${{ secrets.TEST_DNS }}
  52. TestingDomain: ${{ secrets.TestingDomain }}
  53. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  54. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  55. CASE: le_test_dnsapi
  56. TEST_LOCAL: 1
  57. DEBUG: 1
  58. steps:
  59. - uses: actions/checkout@v2
  60. - name: Clone acmetest
  61. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  62. - name: Set env file
  63. run: cd ../acmetest && echo "${{ secrets.TokenName1 }}" >> env.list && echo "${{ secrets.TokenName2 }}" >> env.list && echo "TEST_DNS_NO_WILDCARD" >> env.list && echo "TEST_DNS_SLEEP" >> env.list
  64. - name: Run acmetest
  65. run: cd ../acmetest && ./rundocker.sh _cron
  66. MacOS:
  67. runs-on: macos-latest
  68. needs: Docker
  69. env:
  70. ${{ secrets.TokenName1 }} : ${{ secrets.TokenValue1 }}
  71. ${{ secrets.TokenName2 }} : ${{ secrets.TokenValue2 }}
  72. TEST_DNS : ${{ secrets.TEST_DNS }}
  73. TestingDomain: ${{ secrets.TestingDomain }}
  74. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  75. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  76. CASE: le_test_dnsapi
  77. TEST_LOCAL: 1
  78. DEBUG: 1
  79. steps:
  80. - uses: actions/checkout@v2
  81. - name: Install tools
  82. run: brew update && brew install socat;
  83. - name: Clone acmetest
  84. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  85. - name: Run acmetest
  86. run: cd ../acmetest && ./letest.sh
  87. Windows:
  88. runs-on: windows-latest
  89. needs: MacOS
  90. env:
  91. ${{ secrets.TokenName1 }} : ${{ secrets.TokenValue1 }}
  92. ${{ secrets.TokenName2 }} : ${{ secrets.TokenValue2 }}
  93. TEST_DNS : ${{ secrets.TEST_DNS }}
  94. TestingDomain: ${{ secrets.TestingDomain }}
  95. TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
  96. TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
  97. CASE: le_test_dnsapi
  98. TEST_LOCAL: 1
  99. DEBUG: 1
  100. steps:
  101. - name: Set git to use LF
  102. run: |
  103. git config --global core.autocrlf false
  104. - uses: actions/checkout@v2
  105. - name: Install cygwin base packages with chocolatey
  106. run: |
  107. choco config get cacheLocation
  108. choco install --no-progress cygwin
  109. shell: cmd
  110. - name: Install cygwin additional packages
  111. run: |
  112. C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
  113. shell: cmd
  114. - name: Set ENV
  115. run: |
  116. echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
  117. - name: Clone acmetest
  118. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  119. - name: Run acmetest
  120. shell: cmd
  121. run: cd ../acmetest && bash.exe -c ./letest.sh