tests.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. name: Tests
  3. on:
  4. pull_request:
  5. branches:
  6. - main
  7. paths-ignore:
  8. - 'docs/**'
  9. push:
  10. branches:
  11. - main
  12. paths-ignore:
  13. - 'docs/**'
  14. permissions:
  15. contents: read
  16. jobs:
  17. tests:
  18. runs-on: ubuntu-latest
  19. strategy:
  20. fail-fast: false
  21. matrix:
  22. php-versions: ['8.2', '8.3', '8.4']
  23. env:
  24. GOEXPERIMENT: cgocheck2
  25. GOMAXPROCS: 10
  26. LIBRARY_PATH: ${{ github.workspace }}/watcher/target/lib
  27. steps:
  28. -
  29. uses: actions/checkout@v4
  30. -
  31. uses: actions/setup-go@v5
  32. with:
  33. go-version: '1.22'
  34. cache-dependency-path: |
  35. go.sum
  36. caddy/go.sum
  37. -
  38. uses: shivammathur/setup-php@v2
  39. with:
  40. php-version: ${{ matrix.php-versions }}
  41. ini-file: development
  42. coverage: none
  43. tools: none
  44. env:
  45. phpts: ts
  46. debug: true
  47. -
  48. name: Install e-dant/watcher
  49. uses: ./.github/actions/watcher
  50. -
  51. name: Set Set CGO flags
  52. run: echo "CGO_CFLAGS=-I${PWD}/watcher/target/include $(php-config --includes)" >> "${GITHUB_ENV}"
  53. -
  54. name: Build
  55. run: go build
  56. -
  57. name: Build testcli binary
  58. working-directory: internal/testcli/
  59. run: go build
  60. -
  61. name: Run library tests
  62. run: go test -race -v ./...
  63. -
  64. name: Run Caddy module tests
  65. working-directory: caddy/
  66. run: go test -tags nobadger,nomysql,nopgx -race -v ./...
  67. -
  68. name: Run Fuzzing Tests
  69. working-directory: caddy/
  70. run: go test -fuzz FuzzRequest -fuzztime 20s
  71. -
  72. name: Build the server
  73. working-directory: caddy/frankenphp/
  74. run: go build
  75. -
  76. name: Start the server
  77. working-directory: testdata/
  78. run: sudo ../caddy/frankenphp/frankenphp start
  79. -
  80. name: Run integrations tests
  81. run: ./reload_test.sh
  82. -
  83. name: Lint Go code
  84. uses: golangci/golangci-lint-action@v6
  85. if: matrix.php-versions == '8.4'
  86. with:
  87. version: latest