This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 96e7debd authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Merge branch 'do_not_hide_pipline_failure' into 'development'

Improve pipeline

See merge request sharing/codeability-sharing-platform!95
parents 1c96011f 390293ce
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
...@@ -5,21 +5,61 @@ cache: ...@@ -5,21 +5,61 @@ cache:
paths: paths:
- .maven/ - .maven/
stages: stages:
- check - lint
- build - build
- test - test
- analyze - analyze
- package - package
- release - release
- deploy - deploy
before_script: before_script:
- export NG_CLI_ANALYTICS="false" - export NG_CLI_ANALYTICS="false"
- export MAVEN_USER_HOME=`pwd`/.maven - export MAVEN_USER_HOME=`pwd`/.maven
nohttp: pmd:
stage: check stage: lint
cache: {}
allow_failure: true
when: always
before_script:
- 'export VERSION="6.40.0"'
- 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
- 'jar -xf "pmd-bin-$VERSION.zip"'
- 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
script:
- '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log'
needs: []
artifacts:
when: on_failure
paths:
- pmd.log
checkstyle:
stage: lint
script: script:
- ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME
needs: []
prettier:
stage: lint
cache: {}
script:
- npm install
- npm run prettier:check
allow_failure: true
needs: []
eslint:
stage: lint
cache: {}
script:
- npm install
# eslint exits 0 on warnings, this is a workaround to exit 1 when warnings are present.
- 'npm run lint | tee lint.log'
- "! grep -qE '✖ [0-9]+ problem' lint.log"
allow_failure: true
needs: []
maven-compile: maven-compile:
stage: build stage: build
...@@ -30,18 +70,16 @@ maven-compile: ...@@ -30,18 +70,16 @@ maven-compile:
- target/classes/ - target/classes/
- target/generated-sources/ - target/generated-sources/
expire_in: 1 day expire_in: 1 day
needs: []
maven-test: maven-test:
# DinD service is required for Testcontainers # DinD service is required for Testcontainers
services: services:
- docker:20-dind - docker:20-dind
variables: variables:
# Instruct Testcontainers to use the daemon of DinD. # Instruct Testcontainers to use the daemon of DinD.
DOCKER_HOST: 'tcp://docker:2375' DOCKER_HOST: 'tcp://docker:2375'
DOCKER_TLS_CERTDIR: '' DOCKER_TLS_CERTDIR: ''
# before_script:
# - docker info
stage: test stage: test
script: script:
- ./mvnw -ntp test -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers || FAILED=true - ./mvnw -ntp test -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers || FAILED=true
...@@ -55,23 +93,27 @@ maven-test: ...@@ -55,23 +93,27 @@ maven-test:
- target/surefire-reports - target/surefire-reports
- target/failsafe-reports - target/failsafe-reports
- target/site - target/site
when: always
expire_in: 30 day expire_in: 30 day
allow_failure: true allow_failure: true
needs: []
frontend-test: frontend-test:
stage: test stage: test
cache: {}
script: script:
- npm install - npm install
- npm test || FAILED=true - npm test
- ls -Rl target/test-results
artifacts: artifacts:
reports: reports:
junit: target/test-results/TESTS-results-jest.xml junit: target/test-results/TESTS-results-jest.xml
paths: paths:
- target/test-results - target/test-results
- target/jacoco - target/jacoco
when: always
expire_in: 1 day expire_in: 1 day
allow_failure: true allow_failure: true
needs: []
sonar-analyze: sonar-analyze:
stage: analyze stage: analyze
......
<?xml version="1.0"?>
<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
Rules for the PMD linter
</description>
<rule ref="category/java/bestpractices.xml">
<exclude name="GuardLogStatement"/>
<exclude name="UseVarargs"/>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="OnlyOneReturn"/>
<exclude name="ShortClassName"/>
<exclude name="UselessParentheses"/>
<!-- does not work properly with annotation imports -->
<exclude name="UnnecessaryImport"/>
<!-- should be included, removed to find other lints -->
<exclude name="MethodArgumentCouldBeFinal"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="FieldNamingConventions"/>
<exclude name="ShortVariable"/>
<exclude name="LongVariable"/>
<exclude name="UseUnderscoresInNumericLiterals"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="BooleanGetMethodName"/>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter"/>
<exclude name="DataClass"/>
<exclude name="ExcessiveImports"/>
<!-- seems to be broken in its default config -->
<exclude name="LoosePackageCoupling"/>
</rule>
<rule ref="category/java/documentation.xml">
<exclude name="CommentSize"/>
<exclude name="CommentRequired"/>
<exclude name="UncommentedEmptyConstructor"/>
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="AvoidLiteralsInIfCondition"/>
</rule>
<rule ref="category/java/multithreading.xml"></rule>
<rule ref="category/java/performance.xml">
<exclude name="RedundantFieldInitializer"/>
<exclude name="TooFewBranchesForASwitchStatement"/>
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="AvoidFileStream"/>
</rule>
<rule ref="category/java/security.xml"></rule>
</ruleset>
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