name: CI on: workflow_call: env: CGO_LDFLAGS_ALLOW: "-s|-w" PKG_CONFIG_LIBDIR: /opt/imgproxy/lib/pkgconfig LD_LIBRARY_PATH: /opt/imgproxy/lib GOFLAGS: -buildvcs=false jobs: test: runs-on: ubuntu-latest container: image: ghcr.io/imgproxy/imgproxy-base:latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - name: Setup cache uses: actions/cache@v4 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Download mods run: go mod download - name: Mark git workspace as safe run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Test run: go test ./... lint: runs-on: ubuntu-latest container: image: ghcr.io/imgproxy/imgproxy-base:latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - name: Setup cache uses: actions/cache@v4 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Download mods run: go mod download - name: Lint uses: golangci/golangci-lint-action@v7 with: version: v2.1.6 args: --timeout 10m0s env: PKG_CONFIG_LIBDIR: /opt/imgproxy/lib/pkgconfig GOFLAGS: -buildvcs=false c-lint: runs-on: ubuntu-24.04 permissions: contents: read steps: - uses: actions/checkout@v4 with: submodules: true - uses: cpp-linter/cpp-linter-action@v2 id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: file version: 20 tidy-checks: "-*" # disable clang-tidy - name: Fail fast continue-on-error: true # TODO: remove this line in the future if: steps.linter.outputs.checks-failed > 0 run: exit 1