test.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. name: Test
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v4
  11. with:
  12. fetch-depth: 0
  13. - name: Set up Go
  14. uses: actions/setup-go@v5
  15. with:
  16. go-version: 1.25
  17. - name: Build
  18. run:
  19. go build
  20. - name: Generate edgevpnconfig
  21. run: |
  22. ./edgevpn -g > config.yaml
  23. - name: Upload results
  24. uses: actions/upload-artifact@v4
  25. with:
  26. name: connection
  27. path: config.yaml
  28. if-no-files-found: error
  29. - name: Upload results
  30. uses: actions/upload-artifact@v4
  31. with:
  32. name: edgevpn
  33. path: edgevpn
  34. if-no-files-found: error
  35. test-suite:
  36. runs-on: ubuntu-latest
  37. needs: build
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v4
  41. with:
  42. fetch-depth: 0
  43. - name: Set up Go
  44. uses: actions/setup-go@v5
  45. with:
  46. go-version: 1.25
  47. - name: Download result for build
  48. uses: actions/download-artifact@v5
  49. with:
  50. name: connection
  51. path: ./
  52. - name: Download result for build
  53. uses: actions/download-artifact@v5
  54. with:
  55. name: edgevpn
  56. path: ./
  57. - name: Test suite
  58. run: |
  59. sudo sysctl -w net.core.rmem_max=2500000
  60. chmod +x edgevpn
  61. EDGEVPNCONFIG=config.yaml ./.github/tests.sh
  62. - name: Codecov
  63. uses: codecov/[email protected]
  64. with:
  65. file: coverage.txt
  66. vpntest:
  67. runs-on: ubuntu-latest
  68. needs: build
  69. strategy:
  70. matrix:
  71. include:
  72. - ip: "10.1.0.13/24"
  73. target_ip: "10.1.0.11"
  74. role: "download"
  75. - ip: "10.1.0.11/24"
  76. target_ip: "10.1.0.13"
  77. role: ""
  78. steps:
  79. - name: Checkout
  80. uses: actions/checkout@v4
  81. with:
  82. fetch-depth: 0
  83. - name: Download result for build
  84. uses: actions/download-artifact@v5
  85. with:
  86. name: connection
  87. path: ./
  88. - name: Download result for build
  89. uses: actions/download-artifact@v5
  90. with:
  91. name: edgevpn
  92. path: ./
  93. - name: Ping test
  94. run: |
  95. # Start caddy server to share file across nodes
  96. docker run -d -p 80:80 \
  97. -v $PWD/:/usr/share/caddy/ \
  98. -v caddy_data:/data \
  99. caddy
  100. chmod +x edgevpn
  101. sudo sysctl -w net.core.rmem_max=2500000
  102. sudo EDGEVPNCONFIG=config.yaml IFACE=edgevpn0 ADDRESS=${{ matrix.ip }} ./edgevpn --api --log-level debug &
  103. bash ./.github/vpntest.sh ${{ matrix.target_ip }} ${{ matrix.ip }} ${{ matrix.role }}
  104. servicestest:
  105. runs-on: ubuntu-latest
  106. needs: build
  107. strategy:
  108. matrix:
  109. include:
  110. - role: "expose"
  111. - role: "connect"
  112. steps:
  113. - name: Checkout
  114. uses: actions/checkout@v4
  115. with:
  116. fetch-depth: 0
  117. - name: Download result for build
  118. uses: actions/download-artifact@v5
  119. with:
  120. name: connection
  121. path: ./
  122. - name: Download result for build
  123. uses: actions/download-artifact@v5
  124. with:
  125. name: edgevpn
  126. path: ./
  127. - name: Services test
  128. run: |
  129. chmod +x edgevpn
  130. export EDGEVPNCONFIG=config.yaml
  131. sudo sysctl -w net.core.rmem_max=2500000
  132. bash ./.github/servicestest.sh ${{ matrix.role }}
  133. filestest:
  134. runs-on: ubuntu-latest
  135. needs: build
  136. strategy:
  137. matrix:
  138. include:
  139. - role: "sender"
  140. - role: "receiver"
  141. steps:
  142. - name: Checkout
  143. uses: actions/checkout@v4
  144. with:
  145. fetch-depth: 0
  146. - name: Download result for build
  147. uses: actions/download-artifact@v5
  148. with:
  149. name: connection
  150. path: ./
  151. - name: Download result for build
  152. uses: actions/download-artifact@v5
  153. with:
  154. name: edgevpn
  155. path: ./
  156. - name: File test
  157. run: |
  158. chmod +x edgevpn
  159. export EDGEVPNCONFIG=config.yaml
  160. sudo sysctl -w net.core.rmem_max=2500000
  161. bash ./.github/filetest.sh ${{ matrix.role }}