CI: Adding basic formatting tests (#509)

better names

Using dedicated eclint image

Reconfiguring editorconfig

Removing intellij-specific configuration and making adjustments.

Final improvements

Minor improvements.

end_of_line = lf

Adding basic formatting tests.

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/509
Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
opyale 2020-05-27 18:09:55 +00:00 committed by 6543
parent 34f8f82b63
commit f1eb632d9b
2 changed files with 65 additions and 10 deletions

View File

@ -1,21 +1,59 @@
---
kind: pipeline
name: gitnex-ci-test
type: docker
name: tests
steps:
- name: test
- name: unit-tests
image: nextcloudci/android:android-49
depends_on: [ clone ]
commands:
- ./gradlew test
- name: check-formatting
image: odannyc/eclint:latest
depends_on: [ clone ]
commands:
- git pull origin master
- eclint check $(git diff --name-only origin/master)
# This may be used in the future, because it makes of intellij's native code inspection/formatting capabilities.
# Additional information: https://www.jetbrains.com/help/idea/command-line-formatter.html
#
# - name: do-or-check-formatting
# image: dlsniper/docker-intellij
# depends_on: [ clone ]
# commands:
# - /opt/intellij/bin/idea.sh inspect/format ...
trigger:
event:
- pull_request
---
kind: pipeline
name: gitnex-ci-build
type: docker
name: code-analysis
steps:
- name: check-global-formatting
image: odannyc/eclint:latest
depends_on: [ clone ]
commands:
- eclint check $(git ls-files)
trigger:
event:
- push
branch:
- master
---
kind: pipeline
type: docker
name: build
steps:
@ -43,15 +81,15 @@ steps:
- name: publish
image: vividboarder/drone-webdav
username: GitNexBot
file: 'signed.apk'
destination: 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/GitNex-Builds/latest.apk'
custom_arguments: '--progress-bar'
timeout: 180
attempts: 5
environment:
WEBDAV_USERNAME: GitNexBot
WEBDAV_PASSWORD:
PLUGIN_PASSWORD:
from_secret: NC_TOKEN
PLUGIN_FILE: 'signed.apk'
PLUGIN_TIMEOUT: 180
PLUGIN_ATTEMPTS: 5
PLUGIN_DESTINATION: 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/GitNex-Builds/latest.apk'
PLUGIN_CUSTOM_ARGUMENTS: '--progress-bar'
trigger:
event:

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 150
[*.java]
indent_style = tab
max_line_length = 220
[*.json]
indent_size = 2
[{*.yml,*.yaml}]
indent_size = 2