1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00

Lint with GH actions

This commit is contained in:
DarthSim 2022-03-31 16:10:08 +06:00
parent ffee57aef7
commit 40e332c4f0
2 changed files with 50 additions and 12 deletions

View File

@ -7,16 +7,8 @@ RUN apt-get -qq update \
build-essential \
curl \
git \
mercurial \
make \
binutils \
bison \
gcc \
gobject-introspection \
libglib2.0-dev \
libexpat1-dev \
libxml2-dev \
libfftw3-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
@ -27,9 +19,8 @@ RUN apt-get -qq update \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libopencv-dev
RUN curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | bash -
libopencv-core-dev \
libopencv-dnn-dev
RUN \
mkdir /root/vips \
@ -59,7 +50,14 @@ RUN \
&& rm -rf $VIPS_RELEASE.tar.gz vips-$VIPS_RELEASE; \
done
RUN echo "Name: OpenCV\n" \
"Description: Open Source Computer Vision Library\n" \
"Version: 4.5.1\n" \
"Libs: -L/usr/lib/x86_64-linux-gnu -lopencv_dnn -lopencv_imgproc -lopencv_core\n" \
"Libs.private: -ldl -lm -lpthread -lrt\n" \
"Cflags: -I/usr/include/opencv4\n" \
> /usr/lib/x86_64-linux-gnu/pkgconfig/opencv4.pc
WORKDIR /go/src
ENV GOPATH=/go
ENTRYPOINT [ "/bin/bash" ]

40
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Lint
on:
- push
- pull_request
env:
CGO_LDFLAGS_ALLOW: "-s|-w"
jobs:
lint:
runs-on: ubuntu-latest
container:
image: darthsim/imgproxy-ci:latest
strategy:
matrix:
go-version: ["1.18.x"]
vips-version: ["8.12"]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Cache mods
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Download mods
run: go mod download
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
args: --timeout 2m0s
skip-cache: true
env:
LD_LIBRARY_PATH: "${{ env.LD_LIBRARY_PATH }}:/root/vips/${{ matrix.vips-version }}/lib"
PKG_CONFIG_PATH: "${{ env.PKG_CONFIG_PATH }}:/root/vips/${{ matrix.vips-version }}/lib/pkgconfig"