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 kind: pipeline
name: gitnex-ci-test type: docker
name: tests
steps: steps:
- name: test - name: unit-tests
image: nextcloudci/android:android-49 image: nextcloudci/android:android-49
depends_on: [ clone ]
commands: commands:
- ./gradlew test - ./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: trigger:
event: event:
- pull_request - pull_request
--- ---
kind: pipeline 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: steps:
@ -43,15 +81,15 @@ steps:
- name: publish - name: publish
image: vividboarder/drone-webdav 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: environment:
WEBDAV_USERNAME: GitNexBot PLUGIN_PASSWORD:
WEBDAV_PASSWORD:
from_secret: NC_TOKEN 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: trigger:
event: 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