diff --git a/.drone.yml b/.drone.yml index ac8c929181f45..ed78708f09ed3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,10 @@ workspace: base: /go path: src/code.gitea.io/gitea +trigger: + event: + - pull_request + steps: - name: deps-frontend pull: always @@ -77,6 +81,109 @@ steps: - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit depends_on: [lint-backend] +--- +kind: pipeline +name: testing-master + +platform: + os: linux + arch: amd64 + +workspace: + base: /go + path: src/code.gitea.io/gitea + +trigger: + branch: + - master + event: + - push + +services: + - name: mysql + pull: default + image: mysql:5.7 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: test + GOPROXY: off + TAGS: bindata sqlite sqlite_unlock_notify + GITLAB_READ_TOKEN: + from_secret: gitlab_read_token + depends_on: + - build + + - name: ldap + pull: default + image: gitea/test-openldap:latest + + - name: elasticsearch + pull: default + environment: + discovery.type: single-node + image: elasticsearch:7.5.0 + +steps: + - name: build + pull: always + image: golang:1.14 + commands: + - make backend + 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 + pull: always + image: golang:1.14 + commands: + - make unit-test-coverage test-check + environment: + GOPROXY: off + TAGS: bindata sqlite sqlite_unlock_notify + GITHUB_READ_TOKEN: + from_secret: github_read_token + + - name: test-mysql + pull: always + image: golang:1.14 + commands: + - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" + - apt-get install -y git-lfs + - make test-mysql-migration integration-test-coverage + environment: + GOPROXY: off + TAGS: bindata + TEST_LDAP: 1 + USE_REPO_TEST_DIR: 1 + depends_on: + - build + + - name: generate-coverage + pull: always + image: golang:1.14 + commands: + - make coverage + environment: + GOPROXY: off + TAGS: bindata + depends_on: + - unit-test + - test-mysql + + - name: coverage + pull: always + image: robertstettner/drone-codecov + settings: + files: + - coverage.all + environment: + CODECOV_TOKEN: + from_secret: codecov_token + depends_on: + - generate-coverage + --- kind: pipeline name: testing-amd64 @@ -92,6 +199,10 @@ workspace: base: /go path: src/code.gitea.io/gitea +trigger: + event: + - pull_request + services: - name: mysql pull: default @@ -105,12 +216,6 @@ services: from_secret: gitlab_read_token depends_on: - build - when: - branch: - - master - event: - - push - - pull_request - name: mysql8 pull: default @@ -138,16 +243,6 @@ services: image: elasticsearch:7.5.0 steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - name: build pull: always image: golang:1.14 @@ -158,12 +253,6 @@ steps: GOSUMDB: sum.golang.org TAGS: bindata sqlite sqlite_unlock_notify - - name: tag-pre-condition - pull: always - image: alpine/git - commands: - - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA} - - name: unit-test pull: always image: golang:1.14 @@ -231,12 +320,6 @@ steps: depends_on: - unit-test - test-mysql - when: - branch: - - master - event: - - push - - pull_request - name: coverage pull: always @@ -249,12 +332,6 @@ steps: from_secret: codecov_token depends_on: - generate-coverage - when: - branch: - - master - event: - - push - - pull_request --- kind: pipeline @@ -271,6 +348,10 @@ workspace: base: /go path: src/code.gitea.io/gitea +trigger: + event: + - pull_request + services: - name: pgsql pull: default @@ -284,16 +365,6 @@ services: image: gitea/test-openldap:latest steps: - - name: fetch-tags - pull: default - image: docker:git - commands: - - git fetch --tags --force - when: - event: - exclude: - - pull_request - - name: build pull: always image: golang:1.14 @@ -415,8 +486,7 @@ trigger: - push depends_on: - - testing-amd64 - - testing-arm64 + - testing-master - translations steps: @@ -513,10 +583,6 @@ trigger: event: - tag -depends_on: - - testing-arm64 - - testing-amd64 - steps: - name: fetch-tags pull: default @@ -625,14 +691,13 @@ workspace: base: /go path: src/code.gitea.io/gitea -depends_on: - - testing-amd64 - - testing-arm64 - trigger: ref: - - refs/heads/master - - "refs/tags/**" + - refs/heads/master + - "refs/tags/**" + event: + exclude: + - pull_request steps: - name: fetch-tags @@ -654,10 +719,6 @@ steps: from_secret: docker_password username: from_secret: docker_username - when: - event: - exclude: - - pull_request --- kind: pipeline @@ -675,8 +736,8 @@ depends_on: - compliance trigger: - ref: - - "refs/pull/**" + event: + - pull_request steps: - name: dryrun @@ -688,9 +749,6 @@ steps: tags: linux-arm64 build_args: - GOPROXY=off - when: - event: - - pull_request --- kind: pipeline @@ -710,8 +768,12 @@ depends_on: trigger: ref: - - refs/heads/master - - "refs/tags/**" + - refs/heads/master + - "refs/tags/**" + event: + exclude: + - pull_request + steps: - name: fetch-tags pull: default @@ -732,10 +794,6 @@ steps: from_secret: docker_password username: from_secret: docker_username - when: - event: - exclude: - - pull_request --- kind: pipeline @@ -745,6 +803,18 @@ platform: os: linux arch: amd64 +trigger: + ref: + - refs/heads/master + - "refs/tags/**" + event: + exclude: + - pull_request + +depends_on: + - docker-linux-amd64-release + - docker-linux-arm64-release + steps: - name: manifest pull: always @@ -758,15 +828,6 @@ steps: username: from_secret: docker_username -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: - - docker-linux-amd64-release - - docker-linux-arm64-release - --- kind: pipeline name: notifications