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.

146 lines
4.2 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
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
4 years ago
4 years ago
4 years ago
4 years ago
  1. name: LetsEncrypt
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. paths:
  7. - '**.sh'
  8. - '**.yml'
  9. pull_request:
  10. branches:
  11. - dev
  12. paths:
  13. - '**.sh'
  14. - '**.yml'
  15. jobs:
  16. CheckToken:
  17. runs-on: ubuntu-latest
  18. outputs:
  19. hasToken: ${{ steps.step_one.outputs.hasToken }}
  20. env:
  21. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  22. steps:
  23. - name: Set the value
  24. id: step_one
  25. run: |
  26. if [ "$NGROK_TOKEN" ] ; 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. Ubuntu:
  34. runs-on: ubuntu-latest
  35. needs: CheckToken
  36. if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
  37. env:
  38. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  39. TEST_LOCAL: 1
  40. steps:
  41. - uses: actions/checkout@v2
  42. - name: Install tools
  43. run: sudo apt-get install -y socat
  44. - name: Clone acmetest
  45. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  46. - name: Run acmetest
  47. run: cd ../acmetest && sudo --preserve-env ./letest.sh
  48. MacOS:
  49. runs-on: macos-latest
  50. needs: Ubuntu
  51. env:
  52. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  53. TEST_LOCAL: 1
  54. steps:
  55. - uses: actions/checkout@v2
  56. - name: Install tools
  57. run: brew update && brew install socat;
  58. - name: Clone acmetest
  59. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  60. - name: Run acmetest
  61. run: cd ../acmetest && sudo --preserve-env ./letest.sh
  62. Windows:
  63. runs-on: windows-latest
  64. needs: MacOS
  65. env:
  66. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  67. TEST_LOCAL: 1
  68. #The 80 port is used by Windows server, we have to use a custom port, ngrok will also use this port.
  69. Le_HTTPPort: 8888
  70. steps:
  71. - name: Set git to use LF
  72. run: |
  73. git config --global core.autocrlf false
  74. - uses: actions/checkout@v2
  75. - name: Install cygwin base packages with chocolatey
  76. run: |
  77. choco config get cacheLocation
  78. choco install --no-progress cygwin
  79. shell: cmd
  80. - name: Install cygwin additional packages
  81. run: |
  82. C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
  83. shell: cmd
  84. - name: Set ENV
  85. shell: cmd
  86. run: |
  87. echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV%
  88. - name: Check ENV
  89. shell: cmd
  90. run: |
  91. echo "PATH=%PATH%"
  92. - name: Clone acmetest
  93. shell: cmd
  94. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  95. - name: Run acmetest
  96. shell: cmd
  97. run: cd ../acmetest && bash.exe -c ./letest.sh
  98. FreeBSD:
  99. runs-on: macos-latest
  100. needs: Windows
  101. env:
  102. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  103. TEST_LOCAL: 1
  104. steps:
  105. - uses: actions/checkout@v2
  106. - name: Clone acmetest
  107. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  108. - uses: vmactions/freebsd@main
  109. with:
  110. envs: 'NGROK_TOKEN TEST_LOCAL'
  111. prepare: pkg install -y socat
  112. run: |
  113. cd ../acmetest && ./letest.sh
  114. Solaris:
  115. runs-on: macos-latest
  116. needs: FreeBSD
  117. env:
  118. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  119. TEST_LOCAL: 1
  120. steps:
  121. - uses: actions/checkout@v2
  122. - uses: vmactions/ngrok-tunnel@v0.0.1
  123. id: ngrok
  124. with:
  125. protocol: http
  126. port: 8080
  127. - name: Set envs
  128. run: echo "TestingDomain=${{steps.ngrok.outputs.server}}" >> $GITHUB_ENV
  129. - name: Clone acmetest
  130. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  131. - uses: vmactions/solaris-vm@v0.0.1
  132. with:
  133. envs: 'TEST_LOCAL TestingDomain'
  134. nat: |
  135. "8080": "80"
  136. prepare: pkgutil -y -i socat curl
  137. run: |
  138. cd ../acmetest && ./letest.sh