tests.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. -
  43. name: Set CGO flags
  44. run: |
  45. echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
  46. -
  47. name: Build
  48. run: go build
  49. -
  50. name: Build testcli binary
  51. working-directory: internal/testcli/
  52. run: go build
  53. -
  54. name: Run library tests
  55. run: go test -race -v ./...
  56. -
  57. name: Run Caddy module tests
  58. working-directory: caddy/
  59. run: go test -race -v ./...
  60. -
  61. name: Build the server
  62. working-directory: caddy/frankenphp/
  63. run: go build
  64. -
  65. name: Start the server
  66. working-directory: testdata/
  67. run: sudo ../caddy/frankenphp/frankenphp start
  68. -
  69. name: Run integrations tests
  70. run: ./reload_test.sh
  71. -
  72. name: Lint Go code
  73. uses: golangci/golangci-lint-action@v4
  74. with:
  75. version: latest