tests.yaml 1.7 KB

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