2018-10-30 19:28:48 +02:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build:
|
|
|
|
jobs:
|
|
|
|
- checkout_code
|
2019-04-11 16:07:09 +02:00
|
|
|
- lint:
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.12"
|
|
|
|
vips_version: "8.7"
|
|
|
|
- build:
|
2019-04-11 16:09:32 +02:00
|
|
|
name: go1.12_vips8.7
|
2019-04-11 16:07:09 +02:00
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.12"
|
|
|
|
vips_version: "8.7"
|
|
|
|
- build:
|
2019-04-11 16:09:32 +02:00
|
|
|
name: go1.12_vips8.6
|
2019-04-11 16:07:09 +02:00
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.12"
|
|
|
|
vips_version: "8.6"
|
|
|
|
- build:
|
2019-04-11 16:09:32 +02:00
|
|
|
name: go1.12_vips8.5
|
2019-04-11 16:07:09 +02:00
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.12"
|
|
|
|
vips_version: "8.5"
|
2018-10-30 19:28:48 +02:00
|
|
|
- build:
|
|
|
|
name: go1.11_vips8.7
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.11"
|
|
|
|
vips_version: "8.7"
|
|
|
|
- build:
|
|
|
|
name: go1.11_vips8.6
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.11"
|
|
|
|
vips_version: "8.6"
|
|
|
|
- build:
|
|
|
|
name: go1.11_vips8.5
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.11"
|
|
|
|
vips_version: "8.5"
|
|
|
|
- build:
|
|
|
|
name: go1.10_vips8.7
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.10"
|
|
|
|
vips_version: "8.7"
|
|
|
|
- build:
|
|
|
|
name: go1.10_vips8.6
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.10"
|
|
|
|
vips_version: "8.6"
|
|
|
|
- build:
|
|
|
|
name: go1.10_vips8.5
|
|
|
|
requires:
|
|
|
|
- checkout_code
|
|
|
|
go_version: "1.10"
|
|
|
|
vips_version: "8.5"
|
|
|
|
|
2019-06-13 14:09:57 +02:00
|
|
|
executors:
|
|
|
|
imgproxy:
|
|
|
|
docker:
|
|
|
|
- image: "darthsim/imgproxy-circleci:latest"
|
|
|
|
working_directory: /go/src/imgproxy
|
|
|
|
environment:
|
|
|
|
BASH_ENV: "/root/.bashrc"
|
|
|
|
|
|
|
|
commands:
|
2019-06-13 14:18:07 +02:00
|
|
|
setup_vips:
|
|
|
|
parameters:
|
|
|
|
vips_version:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- run: |
|
|
|
|
echo 'LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/root/vips/<< parameters.vips_version >>/lib"' >> $BASH_ENV
|
|
|
|
echo 'PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/root/vips/<< parameters.vips_version >>/lib/pkgconfig"' >> $BASH_ENV
|
|
|
|
|
2019-06-13 14:09:57 +02:00
|
|
|
install_go:
|
|
|
|
parameters:
|
|
|
|
go_version:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- run: |
|
|
|
|
gvm install go<< parameters.go_version >> -B
|
|
|
|
gvm use go<< parameters.go_version >> --default
|
|
|
|
echo 'export GOPATH=/go' >> $BASH_ENV
|
|
|
|
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> $BASH_ENV
|
|
|
|
echo 'export CGO_LDFLAGS_ALLOW="-s|-w"' >> $BASH_ENV
|
|
|
|
|
2018-10-30 19:28:48 +02:00
|
|
|
jobs:
|
|
|
|
checkout_code:
|
|
|
|
docker:
|
|
|
|
- image: circleci/slim-base:latest
|
|
|
|
working_directory: /go/src/imgproxy
|
|
|
|
steps:
|
|
|
|
- checkout:
|
|
|
|
path: /go/src/imgproxy
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths: [.]
|
|
|
|
|
2019-04-11 16:07:09 +02:00
|
|
|
lint:
|
2019-06-13 14:09:57 +02:00
|
|
|
executor: imgproxy
|
2019-04-11 16:07:09 +02:00
|
|
|
parameters:
|
2019-06-13 14:18:07 +02:00
|
|
|
vips_version:
|
|
|
|
type: string
|
2019-04-11 16:07:09 +02:00
|
|
|
go_version:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2019-06-13 14:18:07 +02:00
|
|
|
- setup_vips:
|
|
|
|
vips_version: << parameters.vips_version >>
|
2019-06-13 14:09:57 +02:00
|
|
|
- install_go:
|
|
|
|
go_version: << parameters.go_version >>
|
2019-04-11 16:07:09 +02:00
|
|
|
- run:
|
2019-06-13 14:09:57 +02:00
|
|
|
name: Install golangci-lint
|
|
|
|
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=golangci-lint sh -s -- -b $(go env GOPATH)/bin v1.16.0
|
|
|
|
- run:
|
|
|
|
name: Lint imgproxy
|
|
|
|
command: golangci-lint run .
|
2019-04-11 16:07:09 +02:00
|
|
|
|
2018-10-30 19:28:48 +02:00
|
|
|
build:
|
2019-06-13 14:09:57 +02:00
|
|
|
executor: imgproxy
|
2018-10-30 19:28:48 +02:00
|
|
|
parameters:
|
2019-06-13 14:18:07 +02:00
|
|
|
vips_version:
|
|
|
|
type: string
|
2018-10-30 19:28:48 +02:00
|
|
|
go_version:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2019-06-13 14:18:07 +02:00
|
|
|
- setup_vips:
|
|
|
|
vips_version: << parameters.vips_version >>
|
2019-06-13 14:09:57 +02:00
|
|
|
- install_go:
|
2019-06-13 14:18:07 +02:00
|
|
|
go_version: << parameters.go_version >>
|
2018-10-30 19:28:48 +02:00
|
|
|
- run:
|
|
|
|
name: Build imgproxy
|
2019-06-13 14:09:57 +02:00
|
|
|
command: go test -v
|