aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci-drone.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci-drone.yml')
-rw-r--r--.gitlab-ci-drone.yml170
1 files changed, 170 insertions, 0 deletions
diff --git a/.gitlab-ci-drone.yml b/.gitlab-ci-drone.yml
new file mode 100644
index 000000000..b65a7d2c4
--- /dev/null
+++ b/.gitlab-ci-drone.yml
@@ -0,0 +1,170 @@
+---
+kind: pipeline
+name: compliance
+
+volumes:
+ - name: deps
+ temp: {}
+
+steps:
+ - name: deps-backend
+ image: golang:1.18rc1-bullseye
+ pull: always
+ commands:
+ - make deps-backend
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: fix-permissions
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ commands:
+ - chown -R gitea:gitea . /go
+
+ - name: lint-backend
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ user: gitea
+ commands:
+ - make backend lint-backend # make backend first because lint can break in very strange ways when something does not build
+ environment:
+ GOSUMDB: sum.golang.org
+ TAGS: bindata sqlite sqlite_unlock_notify
+ depends_on: [deps-backend]
+
+---
+kind: pipeline
+name: testing-amd64
+
+depends_on:
+ - compliance
+
+volumes:
+ - name: deps
+ temp: {}
+
+services:
+ - name: mysql
+ image: mysql:5.7
+ environment:
+ MYSQL_ALLOW_EMPTY_PASSWORD: yes
+ MYSQL_DATABASE: test
+
+ - name: ldap
+ image: gitea/test-openldap:latest
+
+steps:
+ - name: deps-backend
+ image: golang:1.18rc1-bullseye
+ pull: always
+ commands:
+ - make deps-backend
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: fix-permissions
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ commands:
+ - chown -R gitea:gitea . /go
+
+ - name: build
+ pull: always
+ image: golang:1.18rc1-bullseye
+ commands:
+ - make backend
+ environment:
+ GOPROXY: off
+ GOSUMDB: sum.golang.org
+ TAGS: bindata sqlite sqlite_unlock_notify
+ depends_on: [deps-backend]
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: unit-test
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ user: gitea
+ commands:
+ - make unit-test-coverage
+ environment:
+ GOPROXY: off
+ TAGS: bindata sqlite sqlite_unlock_notify
+ depends_on: [deps-backend, build]
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: test-mysql
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ user: gitea
+ commands:
+ - make test-mysql-migration integration-test-coverage
+ environment:
+ GOPROXY: off
+ TAGS: bindata
+ TEST_LDAP: 1
+ USE_REPO_TEST_DIR: 1
+ depends_on: [deps-backend, build]
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: test-sqlite
+ image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
+ user: gitea
+ commands:
+ - timeout -s ABRT 40m make test-sqlite-migration test-sqlite
+ environment:
+ GOPROXY: off
+ TAGS: bindata gogit sqlite sqlite_unlock_notify
+ TEST_TAGS: bindata gogit sqlite sqlite_unlock_notify
+ USE_REPO_TEST_DIR: 1
+ depends_on: [deps-backend, build]
+ volumes:
+ - name: deps
+ path: /go
+
+ - name: generate-coverage
+ image: golang:1.18rc1-bullseye
+ commands:
+ - make coverage
+ - go tool cover -html=coverage.all -o coverage.html
+ environment:
+ TAGS: bindata
+ depends_on:
+ - unit-test
+ - test-mysql
+
+---
+kind: pipeline
+name: docs
+
+trigger:
+ event:
+ - push
+ - tag
+ - pull_request
+
+steps:
+ - name: build-docs
+ pull: always
+ image: plugins/hugo:latest
+ commands:
+ - apk add --no-cache make bash curl
+ - cd docs
+ - make trans-copy clean build
+
+ - name: publish-docs
+ pull: always
+ image: techknowlogick/drone-netlify:latest
+ settings:
+ path: docs/public/
+ site_id: d2260bae-7861-4c02-8646-8f6440b12672
+ environment:
+ NETLIFY_TOKEN:
+ from_secret: netlify_token
+ when:
+ branch:
+ - main
+ event:
+ - push