ci: try re-ordering for optimizing time

This commit is contained in:
Antoine GIRARD 2020-01-12 05:56:12 +01:00
parent e1fa574699
commit dff29f12c8

View file

@ -1,6 +1,6 @@
--- ---
kind: pipeline kind: pipeline
name: init name: compatibility
platform: platform:
os: linux os: linux
@ -10,40 +10,6 @@ workspace:
base: /go base: /go
path: src/code.gitea.io/gitea path: src/code.gitea.io/gitea
steps:
- name: fetch-tags
pull: default
image: docker:git
commands:
- git fetch --tags --force
when:
event:
exclude:
- pull_request
- name: tag-pre-condition
pull: always
image: alpine/git
commands:
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
when:
event:
- tag
---
kind: pipeline
name: build
platform:
os: linux
arch: amd64
workspace:
base: /go
path: src/code.gitea.io/gitea
depends_on:
- init
steps: steps:
- name: pre-build - name: pre-build
pull: always pull: always
@ -74,18 +40,16 @@ steps:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
- name: generate-build - name: check
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make clean - make clean
- make golangci-lint - make golangci-lint
- make revive - make revive
- make swagger-check - make swagger-check
- make swagger-validate - make swagger-validate
- make test-vendor - make test-vendor
- make build
environment: environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org GOSUMDB: sum.golang.org
@ -103,9 +67,6 @@ workspace:
base: /go base: /go
path: src/code.gitea.io/gitea path: src/code.gitea.io/gitea
depends_on:
- init
services: services:
- name: mysql - name: mysql
pull: default pull: default
@ -140,6 +101,36 @@ services:
image: gitea/test-openldap:latest image: gitea/test-openldap:latest
steps: steps:
- name: fetch-tags
pull: default
image: docker:git
commands:
- git fetch --tags --force
when:
event:
exclude:
- pull_request
- name: tag-pre-condition
pull: always
image: alpine/git
commands:
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
when:
event:
- tag
- name: build
pull: always
image: golang:1.13
commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
- name: unit-test - name: unit-test
pull: always pull: always
image: golang:1.13 image: golang:1.13
@ -185,6 +176,8 @@ steps:
- name: test-sqlite - name: test-sqlite
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -197,6 +190,8 @@ steps:
- name: test-mysql - name: test-mysql
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -216,6 +211,8 @@ steps:
- name: tag-test-mysql - name: tag-test-mysql
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -232,6 +229,8 @@ steps:
- name: test-mysql8 - name: test-mysql8
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -245,6 +244,8 @@ steps:
- name: test-pgsql - name: test-pgsql
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -258,6 +259,8 @@ steps:
- name: test-mssql - name: test-mssql
pull: always pull: always
image: golang:1.13 image: golang:1.13
depends_on:
- build
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -322,9 +325,6 @@ trigger:
event: event:
- push - push
depends_on:
- init
steps: steps:
- name: download - name: download
pull: always pull: always
@ -591,7 +591,7 @@ workspace:
path: src/code.gitea.io/gitea path: src/code.gitea.io/gitea
depends_on: depends_on:
- build - compatibility
trigger: trigger:
ref: ref:
@ -663,7 +663,7 @@ workspace:
path: src/code.gitea.io/gitea path: src/code.gitea.io/gitea
depends_on: depends_on:
- build - compatibility
trigger: trigger:
ref: ref: