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.

95 lines
2.9 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
  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. jobs:
  15. CheckToken:
  16. runs-on: ubuntu-latest
  17. outputs:
  18. hasToken: ${{ steps.step_one.outputs.hasToken }}
  19. env:
  20. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  21. steps:
  22. - name: Set the value
  23. id: step_one
  24. run: |
  25. if [ "$NGROK_TOKEN" ] ; then
  26. echo "::set-output name=hasToken::true"
  27. else
  28. echo "::set-output name=hasToken::false"
  29. fi
  30. - name: Check the value
  31. run: echo ${{ steps.step_one.outputs.hasToken }}
  32. Ubuntu:
  33. runs-on: ubuntu-latest
  34. needs: CheckToken
  35. if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
  36. env:
  37. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  38. TEST_LOCAL: 1
  39. steps:
  40. - uses: actions/checkout@v2
  41. - name: Install tools
  42. run: sudo apt-get install -y socat
  43. - name: Clone acmetest
  44. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  45. - name: Run acmetest
  46. run: cd ../acmetest && sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ./letest.sh
  47. MacOS:
  48. runs-on: macos-latest
  49. needs: Ubuntu
  50. env:
  51. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  52. TEST_LOCAL: 1
  53. steps:
  54. - uses: actions/checkout@v2
  55. - name: Install tools
  56. run: brew update && brew install socat;
  57. - name: Clone acmetest
  58. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  59. - name: Run acmetest
  60. run: cd ../acmetest && sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ./letest.sh
  61. Windows:
  62. runs-on: windows-latest
  63. needs: MacOS
  64. env:
  65. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  66. TEST_LOCAL: 1
  67. #The 80 port is used by Windows server, we have to use a custom port, ngrok will also use this port.
  68. Le_HTTPPort: 8888
  69. steps:
  70. - uses: actions/checkout@v2
  71. - name: Install cygwin base packages with chocolatey
  72. run: |
  73. choco config get cacheLocation
  74. choco install --no-progress cygwin
  75. shell: cmd
  76. - name: Install cygwin additional packages
  77. run: |
  78. C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
  79. shell: cmd
  80. - name: Set ENV
  81. run: |
  82. echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
  83. - name: Clone acmetest
  84. shell: cmd
  85. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ && sed -i 's/\r//g' acmetest/acme.sh/acme.sh
  86. - name: Run acmetest
  87. shell: cmd
  88. run: cd ../acmetest && bash.exe -c ./letest.sh