tests.yaml 1.8 KB

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