ci.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. GOFLAGS: -buildvcs=false
  53. c-lint:
  54. runs-on: ubuntu-24.04
  55. steps:
  56. - uses: actions/checkout@v4
  57. - uses: cpp-linter/cpp-linter-action@v2
  58. id: linter
  59. with:
  60. style: file
  61. version: 18 # Ubuntu 24.04 provides clang-format-18
  62. tidy-checks: '-*' # disable clang-tidy
  63. - name: Fail fast
  64. continue-on-error: true # TODO: remove this line in the future
  65. if: steps.linter.outputs.checks-failed > 0
  66. run: exit 1