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.

115 lines
3.4 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
  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. run: |
  86. echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
  87. - name: Clone acmetest
  88. shell: cmd
  89. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  90. - name: Run acmetest
  91. shell: cmd
  92. run: cd ../acmetest && bash.exe -c ./letest.sh
  93. FreeBSD:
  94. runs-on: macos-latest
  95. needs: Windows
  96. env:
  97. NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
  98. TEST_LOCAL: 1
  99. steps:
  100. - uses: actions/checkout@v2
  101. - name: Clone acmetest
  102. run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
  103. - uses: vmactions/freebsd@main
  104. with:
  105. envs: 'NGROK_TOKEN TEST_LOCAL'
  106. prepare: pkg install -y socat
  107. run: |
  108. cd ../acmetest && ./letest.sh