tests.yaml 1.6 KB

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