ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: CI
  2. on:
  3. workflow_call:
  4. env:
  5. CGO_LDFLAGS_ALLOW: "-s|-w"
  6. jobs:
  7. test:
  8. runs-on: ubuntu-latest
  9. container:
  10. image: ghcr.io/imgproxy/imgproxy-ci:202410292002
  11. strategy:
  12. matrix:
  13. go-version: ["1.23.x", "1.22.x", "1.21.x"]
  14. vips-version: ["8.16", "8.15", "8.14"]
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v4
  18. - uses: actions/setup-go@v5
  19. with:
  20. go-version: ${{ matrix.go-version }}
  21. - name: Download mods
  22. run: go mod download
  23. - name: Test
  24. run: go test ./...
  25. env:
  26. LD_LIBRARY_PATH: "/usr/local/lib:/root/vips/${{ matrix.vips-version }}/lib"
  27. PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:/root/vips/${{ matrix.vips-version }}/lib/pkgconfig"
  28. lint:
  29. runs-on: ubuntu-latest
  30. container:
  31. image: ghcr.io/imgproxy/imgproxy-ci:202410292002
  32. strategy:
  33. matrix:
  34. go-version: ["1.23.x"]
  35. vips-version: ["8.16"]
  36. steps:
  37. - name: Checkout
  38. uses: actions/checkout@v4
  39. - uses: actions/setup-go@v5
  40. with:
  41. go-version: ${{ matrix.go-version }}
  42. - name: Download mods
  43. run: go mod download
  44. - name: Lint
  45. uses: golangci/golangci-lint-action@v7
  46. with:
  47. version: v2.1.6
  48. args: --timeout 10m0s
  49. env:
  50. LD_LIBRARY_PATH: "/usr/local/lib:/root/vips/${{ matrix.vips-version }}/lib"
  51. PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:/root/vips/${{ matrix.vips-version }}/lib/pkgconfig"
  52. c-lint:
  53. runs-on: ubuntu-24.04
  54. steps:
  55. - uses: actions/checkout@v4
  56. - uses: cpp-linter/cpp-linter-action@v2
  57. id: linter
  58. with:
  59. style: file
  60. version: 18 # Ubuntu 24.04 provides clang-format-18
  61. tidy-checks: '-*' # disable clang-tidy
  62. - name: Fail fast
  63. continue-on-error: true # TODO: remove this line in the future
  64. if: steps.linter.outputs.checks-failed > 0
  65. run: exit 1