Verified Commit 08568d81 authored by Loïc Dachary's avatar Loïc Dachary
Browse files

Merge branch 'feature-gitlab-ci' into base-development

parents d5e6289a de3d427c
Pipeline #627 passed with stage
in 19 minutes and 45 seconds
---
kind: pipeline
name: testing-amd64
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: build
pull: always
image: golang:1.17
commands:
- make backend
environment:
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
- name: fix-permissions
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- chown -R gitea:gitea .
- name: lint-backend
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make lint-backend
environment:
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
- name: unit-test
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
user: gitea
commands:
- make unit-test-coverage
environment:
TAGS: bindata sqlite sqlite_unlock_notify
- 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:
TAGS: bindata
TEST_LDAP: 1
USE_REPO_TEST_DIR: 1
depends_on:
- build
- 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:
TAGS: bindata gogit sqlite sqlite_unlock_notify
TEST_TAGS: bindata gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
depends_on:
- build
- name: generate-coverage
image: golang:1.17
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
depends_on:
- compliance
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
jobs:
tags:
- shell
before_script:
- docker ps -a -q | xargs --no-run-if-empty docker rm -f
script:
- curl -L https://github.com/drone/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx
- chmod +x drone
- ./drone exec --pipeline testing-amd64 .gitlab-ci-drone.yml
after_script:
- docker run --rm --volume $(pwd):/drone/src --workdir /drone/src gitea/test_env:linux-amd64 chown -R $(id -u) .
......@@ -363,7 +363,7 @@ coverage:
.PHONY: unit-test-coverage
unit-test-coverage:
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
@$(GO) test $(GOTESTFLAGS) -cpu=1 -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: vendor
vendor:
......
......@@ -10,8 +10,7 @@ PASSWD = {{TEST_MYSQL_PASSWORD}}
SSL_MODE = disable
[indexer]
ISSUE_INDEXER_TYPE = elasticsearch
ISSUE_INDEXER_CONN_STR = http://elastic:changeme@elasticsearch:9200
ISSUE_INDEXER_PATH = integrations/gitea-integration-mysql/indexers/issues.bleve
ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-mysql/indexers/issues.queue
REPO_INDEXER_ENABLED = true
REPO_INDEXER_PATH = integrations/gitea-integration-mysql/indexers/repos.bleve
......@@ -52,27 +51,8 @@ OFFLINE_MODE = false
LFS_START_SERVER = true
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
[lfs]
MINIO_BASE_PATH = lfs/
[attachment]
MINIO_BASE_PATH = attachments/
[avatars]
MINIO_BASE_PATH = avatars/
[repo-avatars]
MINIO_BASE_PATH = repo-avatars/
[storage]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = minio:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = gitea
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
PATH = integrations/gitea-integration-mysql/data/attachments
[mailer]
ENABLED = true
......
......@@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"testing"
"code.gitea.io/gitea/modules/structs"
......@@ -39,6 +40,10 @@ func testRepoMigrate(t testing.TB, session *TestSession, cloneAddr, repoName str
}
func TestRepoMigrate(t *testing.T) {
if os.Getenv("GITHUB_READ_TOKEN") == "" {
t.Skip("skipped test because GITHUB_READ_TOKEN was not in the environment")
}
defer prepareTestEnv(t)()
session := loginUser(t, "user2")
testRepoMigrate(t, session, "https://github.com/go-gitea/test_repo.git", "git")
......
......@@ -17,6 +17,10 @@ import (
)
func TestGitHubDownloadRepo(t *testing.T) {
if os.Getenv("GITHUB_READ_TOKEN") == "" {
t.Skip("skipped test because GITHUB_READ_TOKEN was not in the environment")
}
GithubLimitRateRemaining = 3 // Wait at 3 remaining since we could have 3 CI in //
downloader := NewGithubDownloaderV3(context.Background(), "https://github.com", "", "", os.Getenv("GITHUB_READ_TOKEN"), "go-gitea", "test_repo")
err := downloader.RefreshRate()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment