Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Develocity configuration and enabled remote build cache. #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ runs:
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
- name: Build Production Code
run: |
./gradlew compileJava --no-daemon
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dash-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
run: |
./gradlew allDependencies | grep -Poh "(?<=\s)[\w.-]+:[\w.-]+:[^:\s\[\]]+" | sort | uniq > dependency-list
cat dependency-list
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Run dash
id: run-dash
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-openapi-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:

- name: Generate openapi spec
run: ./gradlew resolve
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: openapi-spec
Expand Down Expand Up @@ -81,10 +83,14 @@ jobs:
run: |
./gradlew -p ${{ matrix.apiGroup.folder }} downloadOpenapi
cp ${{ matrix.apiGroup.folder }}/build/docs/openapi/* resources/openapi/yaml/${{ matrix.apiGroup.name }}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Merge API specs
run: |
./gradlew -Pversion=${{ env.VERSION }} -PapiTitle="Tractus-X EDC ${{ matrix.apiGroup.name }} API" -PapiDescription="Tractus-X EDC ${{ matrix.apiGroup.name }} API Documentation" :mergeApiSpec --input=./resources/openapi/yaml/${{ matrix.apiGroup.name }} --output=./resources/openapi/yaml/${{ matrix.apiGroup.name }}.yaml
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Generate Swagger UI current version
uses: Legion2/swagger-ui-action@v1
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-swaggerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
shell: bash
run: |
./gradlew resolve
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Download upstream API specs for control-plane and data-plane
run: |
Expand All @@ -77,10 +79,14 @@ jobs:

./gradlew :edc-dataplane:edc-dataplane-base:downloadOpenapi
cp edc-dataplane/edc-dataplane-base/build/docs/openapi/* resources/openapi/yaml/
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: Merge API specs
run: |
./gradlew -PapiTitle="Tractus-X EDC REST API" -PapiDescription="Tractus-X EDC API Documentation" :mergeApiSpec --input=./resources/openapi/yaml --output=./resources/openapi/yaml/tractusx-edc-api.yaml
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

# create API, will fail if exists
- name: Create API
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trigger-maven-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
env:
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}
run: |-

echo "Input Version: ${{ inputs.version }}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upgradeability-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
run: |-
./gradlew :edc-controlplane:edc-controlplane-postgresql-hashicorp-vault:dockerize
./gradlew :edc-dataplane:edc-dataplane-hashicorp-vault:dockerize
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

- name: "Load images into KinD"
shell: bash
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
- name: Run Checkstyle
run: |
./gradlew checkstyleMain checkstyleTest
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

verify-javadoc:
runs-on: ubuntu-latest
Expand All @@ -62,6 +64,8 @@ jobs:

- name: Run Javadoc
run: ./gradlew javadoc
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

unit-tests:
runs-on: ubuntu-latest
Expand All @@ -72,6 +76,8 @@ jobs:

- name: Run Unit tests
run: ./gradlew test
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

integration-tests:
runs-on: ubuntu-latest
Expand All @@ -84,6 +90,8 @@ jobs:
run: |
./gradlew :edc-tests:runtime:mock-connector:dockerize
./gradlew test -DincludeTags="ComponentTest"
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

api-tests:
runs-on: ubuntu-latest
Expand All @@ -94,6 +102,8 @@ jobs:

- name: Run API tests
run: ./gradlew test -DincludeTags="ApiTest"
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

end-to-end-tests:
runs-on: ubuntu-latest
Expand All @@ -119,6 +129,8 @@ jobs:
run: |
./gradlew compileJava compileTestJava
./gradlew -p ${{ matrix.variant.dir }} test -DincludeTags="EndToEndTest" -PverboseTest=true
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}

postgres-tests:
runs-on: ubuntu-latest
Expand All @@ -128,3 +140,5 @@ jobs:

- name: Run Postgresql E2E tests
run: ./gradlew test -DincludeTags="PostgresqlIntegrationTest" --refresh-dependencies
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ version=0.9.0-SNAPSHOT
txScmConnection=scm:git:[email protected]:eclipse-tractusx/tractusx-edc.git
txWebsiteUrl=https://github.com/eclipse-tractusx/tractusx-edc.git
txScmUrl=https://github.com/eclipse-tractusx/tractusx-edc.git

org.gradle.caching=true
31 changes: 31 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ pluginManagement {
}
}

plugins {
id("com.gradle.develocity") version "3.19.2"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.1"
}

dependencyResolutionManagement {
repositories {
maven {
Expand All @@ -127,3 +132,29 @@ dependencyResolutionManagement {
mavenLocal()
}
}

// Develocity
val isCI = System.getenv("CI") != null // adjust to your CI provider

develocity {
server = "https://develocity-staging.eclipse.org"
projectId = "automotive.tractusx"
buildScan {
uploadInBackground = !isCI
publishing.onlyIf { it.isAuthenticated }
obfuscation {
ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
}
}
}

buildCache {
local {
isEnabled = true
}

remote(develocity.buildCache) {
isEnabled = true
isPush = isCI
}
}
Loading