Skip to content
Snippets Groups Projects
Verified Commit 46ed3950 authored by Ruben Backx's avatar Ruben Backx :coffee:
Browse files

Proper multiproject setup

parent a741b07e
No related branches found
No related tags found
No related merge requests found
Pipeline #956254 passed
.idea
.gradle
*.iml
\ No newline at end of file
include:
- '/backend/.gitlab-ci.yml'
- '/frontend/.gitlab-ci.yml'
\ No newline at end of file
# GitBull
---
image: gradle:jdk17
stages: stages:
- build - build
- test - test
#variables: #variables:
# # Disable the Gradle daemon to ensure isolated runs of the CI pipeline. # # Disable the Gradle daemon to ensure isolated runs of the CI pipeline.
# GRADLE_OPTS: "-Dorg.gradle.daemon=false" # GRADLE_OPTS: "-Dorg.gradle.daemon=false"
build: backend:build:
image: gradle:jdk17
stage: build stage: build
needs:
- spotless
cache: cache:
policy: pull-push policy: pull-push
artifacts: artifacts:
...@@ -20,14 +18,15 @@ build: ...@@ -20,14 +18,15 @@ build:
- build/ - build/
- .gradle/ - .gradle/
script: script:
- gradle build -x test -x spotlessJava -x spotlessCheck - gradle backend:build -x test -x spotlessJava -x spotlessCheck
#PMD: #PMD:
# stage: staticAnalysis # stage: staticAnalysis
# script: # script:
# gradle pmdMain # gradle pmdMain
# allow_failure: true # allow_failure: true
spotless: backend:spotless:
image: gradle:jdk17
artifacts: artifacts:
name: spotless name: spotless
expose_as: Spotless expose_as: Spotless
...@@ -37,15 +36,16 @@ spotless: ...@@ -37,15 +36,16 @@ spotless:
stage: build stage: build
allow_failure: true allow_failure: true
script: script:
- gradle spotlessCheck - gradle backend:spotlessCheck
after_script: after_script:
- cp -r build/spotless-diagnose-java spotless-diagnose-java/ - cp -r build/spotless-diagnose-java spotless-diagnose-java/
test: backend:test:
image: gradle:jdk17
stage: test stage: test
needs: needs:
- build - backend:build
cache: cache:
policy: pull-push policy: pull-push
coverage: '/Code coverage: \d+\.\d+/' coverage: '/Code coverage: \d+\.\d+/'
...@@ -62,11 +62,12 @@ test: ...@@ -62,11 +62,12 @@ test:
coverage_report: coverage_report:
coverage_format: cobertura coverage_format: cobertura
path: build/reports/jacoco/test/jacocoTestReport.xml path: build/reports/jacoco/test/jacocoTestReport.xml
before_script:
- mkdir backend/data
script: script:
- gradle test - gradle backend:test
after_script: after_script:
- gradle jacocoTestReport -x processResources -x compileJava -x classes --rerun-tasks - gradle backend:jacocoTestReport -x processResources -x compileJava -x classes --rerun-tasks
# Print test coverage from report # Print test coverage from report
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print "Code coverage:", 100*covered/instructions }' build/reports/jacoco/test/jacocoTestReport.csv || true - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print "Code coverage:", 100*covered/instructions }' build/reports/jacoco/test/jacocoTestReport.csv || true
... ...
......
import com.diffplug.gradle.spotless.SpotlessExtension import com.diffplug.gradle.spotless.SpotlessExtension
group = "areas" group = "nl.tudelft"
version = "0.1" version = "0.1"
val libradorVersion = "1.2.0" val libradorVersion = "1.2.0"
...@@ -205,7 +205,7 @@ tasks.jacocoTestReport { ...@@ -205,7 +205,7 @@ tasks.jacocoTestReport {
xml.required.set(true) xml.required.set(true)
csv.required.set(true) csv.required.set(true)
html.destination = file("$buildDir/reports/coverage") html.outputLocation.set(file("$buildDir/reports/coverage"))
} }
} }
... ...
......
rootProject.name = 'gitbull'
include 'server'
Test Content with non-UTF-8 characters: éñö
File moved
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# Official framework image. Look for the different tagged releases at: # Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/ # https://hub.docker.com/r/library/node/tags/
image: node:latest
# This folder is cached between builds # This folder is cached between builds
# https://docs.gitlab.com/ee/ci/yaml/index.html#cache # https://docs.gitlab.com/ee/ci/yaml/index.html#cache
...@@ -17,8 +16,11 @@ cache: ...@@ -17,8 +16,11 @@ cache:
paths: paths:
- node_modules/ - node_modules/
build: frontend:build:
image: node:latest
stage: build stage: build
before_script:
- cd frontend
script: script:
- npm i - npm i
- npm run build - npm run build
... ...
......
group = "nl.tudelft"
version = "0.1"
plugins {
`kotlin-dsl` apply false
idea
}
repositories {
mavenLocal()
mavenCentral()
}
File moved
File moved
File moved
File moved
rootProject.name = "gitbull"
include("backend", "frontend")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment