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. steps:
  18. -
  19. uses: actions/checkout@v4
  20. -
  21. uses: actions/setup-go@v5
  22. with:
  23. go-version: '1.21'
  24. cache-dependency-path: |
  25. go.sum
  26. caddy/go.sum
  27. -
  28. uses: shivammathur/setup-php@v2
  29. with:
  30. php-version: ${{ matrix.php-versions }}
  31. ini-file: development
  32. coverage: none
  33. tools: none
  34. env:
  35. phpts: ts
  36. -
  37. name: Set CGO flags
  38. run: |
  39. echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV"
  40. -
  41. name: Build
  42. run: go build
  43. env:
  44. GOEXPERIMENT: cgocheck2
  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