tests.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. jobs:
  15. tests:
  16. runs-on: ubuntu-latest
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. php-versions: ['8.2', '8.3']
  21. env:
  22. GOEXPERIMENT: cgocheck2
  23. GOMAXPROCS: 10
  24. steps:
  25. -
  26. uses: actions/checkout@v4
  27. -
  28. uses: actions/setup-go@v5
  29. with:
  30. go-version: '1.22'
  31. cache-dependency-path: |
  32. go.sum
  33. caddy/go.sum
  34. -
  35. uses: shivammathur/setup-php@v2
  36. with:
  37. php-version: ${{ matrix.php-versions }}
  38. ini-file: development
  39. coverage: none
  40. tools: none
  41. env:
  42. phpts: ts
  43. debug: true
  44. -
  45. name: Set CGO flags
  46. run: |
  47. echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
  48. -
  49. name: Build
  50. run: go build
  51. -
  52. name: Build testcli binary
  53. working-directory: internal/testcli/
  54. run: go build
  55. -
  56. name: Run library tests
  57. run: go test -race -v ./...
  58. -
  59. name: Run Caddy module tests
  60. working-directory: caddy/
  61. run: go test -race -v ./...
  62. -
  63. name: Build the server
  64. working-directory: caddy/frankenphp/
  65. run: go build
  66. -
  67. name: Start the server
  68. working-directory: testdata/
  69. run: sudo ../caddy/frankenphp/frankenphp start
  70. -
  71. name: Run integrations tests
  72. run: ./reload_test.sh
  73. -
  74. name: Lint Go code
  75. uses: golangci/golangci-lint-action@v6
  76. if: matrix.php-versions == '8.3'
  77. with:
  78. version: latest