mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-29 08:22:11 +02:00
160 lines
4.0 KiB
YAML
160 lines
4.0 KiB
YAML
version: 2.1
|
|
|
|
workflows:
|
|
version: 2
|
|
build:
|
|
jobs:
|
|
- checkout_code
|
|
- lint:
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.14"
|
|
vips_version: "8.9"
|
|
- build:
|
|
name: go1.14_vips8.9
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.14"
|
|
vips_version: "8.9"
|
|
- build:
|
|
name: go1.14_vips8.8
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.14"
|
|
vips_version: "8.8"
|
|
- build:
|
|
name: go1.14_vips8.7
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.14"
|
|
vips_version: "8.7"
|
|
- build:
|
|
name: go1.13_vips8.9
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.13"
|
|
vips_version: "8.9"
|
|
- build:
|
|
name: go1.13_vips8.8
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.13"
|
|
vips_version: "8.8"
|
|
- build:
|
|
name: go1.13_vips8.7
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.13"
|
|
vips_version: "8.7"
|
|
- build:
|
|
name: go1.12_vips8.9
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.12"
|
|
vips_version: "8.9"
|
|
- build:
|
|
name: go1.12_vips8.8
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.12"
|
|
vips_version: "8.8"
|
|
- build:
|
|
name: go1.12_vips8.7
|
|
requires:
|
|
- checkout_code
|
|
go_version: "1.12"
|
|
vips_version: "8.7"
|
|
|
|
executors:
|
|
imgproxy:
|
|
docker:
|
|
- image: "darthsim/imgproxy-circleci:latest"
|
|
working_directory: /go/src/imgproxy
|
|
environment:
|
|
BASH_ENV: "/root/.bashrc"
|
|
|
|
commands:
|
|
setup_vips:
|
|
parameters:
|
|
vips_version:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: Setup Vips
|
|
command: |
|
|
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
|
|
|
|
install_go:
|
|
parameters:
|
|
go_version:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: Install Go
|
|
command: |
|
|
gvm install go<< parameters.go_version >> -B
|
|
gvm use go<< parameters.go_version >> --default
|
|
echo 'export GO111MODULE=on' >> $BASH_ENV
|
|
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
|
|
|
|
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: [.]
|
|
|
|
lint:
|
|
executor: imgproxy
|
|
parameters:
|
|
vips_version:
|
|
type: string
|
|
go_version:
|
|
type: string
|
|
steps:
|
|
- attach_workspace:
|
|
at: .
|
|
- setup_vips:
|
|
vips_version: << parameters.vips_version >>
|
|
- install_go:
|
|
go_version: << parameters.go_version >>
|
|
- run:
|
|
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.18.0
|
|
- run:
|
|
name: Lint imgproxy
|
|
command: golangci-lint run .
|
|
|
|
build:
|
|
executor: imgproxy
|
|
parameters:
|
|
vips_version:
|
|
type: string
|
|
go_version:
|
|
type: string
|
|
steps:
|
|
- attach_workspace:
|
|
at: .
|
|
- setup_vips:
|
|
vips_version: << parameters.vips_version >>
|
|
- install_go:
|
|
go_version: << parameters.go_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- go-modules-{{ checksum "go.sum" }}
|
|
- run:
|
|
name: Build imgproxy
|
|
command: go test -v
|
|
- save_cache:
|
|
key: go-modules-{{ checksum "go.sum" }}
|
|
paths:
|
|
- "/go/pkg/mod"
|