Skip to content

Commit

Permalink
ci: launch test workflow also on release and bugfix branches
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Aug 22, 2024
1 parent 1654194 commit eec75da
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 201 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/dependency-check.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ jobs:
fi
Run-Tests:
needs: [ Secrets-Presence, Determine-Version ]
uses: ./.github/workflows/verify.yaml
secrets: inherit
with:
version: ${{ needs.Determine-Version.outputs.VERSION }}

Publish-Artefacts:
runs-on: ubuntu-latest
Expand Down
147 changes: 13 additions & 134 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@ name: Run Tests

on:
workflow_call:
inputs:
version:
required: false
type: string
description: optional version of upstream EDC components to use
workflow_dispatch:
inputs:
version:
required: false
type: string
description: optional version of upstream EDC components to use
push:
pull_request:
branches: [ main ]
branches: [ main, release/*, bugfix/* ]
paths-ignore:
- '**.md'
- 'docs/**'
Expand All @@ -28,160 +18,49 @@ concurrency:

jobs:
Checkstyle:
permissions:
id-token: write
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Run Checkstyle
run: ./gradlew checkstyleMain checkstyleTest

CodeQL:
uses: eclipse-edc/.github/.github/workflows/codeql-analysis.yml@main
secrets: inherit

Dependency-Check:
uses: eclipse-edc/.github/.github/workflows/dependency-check.yml@main
secrets: inherit

Unit-Tests:
runs-on: ubuntu-latest
env:
JACOCO: true
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Run unit tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
with:
command: ./gradlew test jacocoTestReport
run: ./gradlew test

Component-Tests:
env:
JACOCO: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION}}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Component Tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
with:
command: ./gradlew jacocoTestReport -DincludeTags="ComponentTest"
run: ./gradlew -DincludeTags="ComponentTest"

End-To-End-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: End to End Integration Tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
with:
command: ./gradlew test -DincludeTags="EndToEndTest"
run: ./gradlew test -DincludeTags="EndToEndTest"

API-Tests:
env:
JACOCO: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Component Tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
with:
command: ./gradlew test jacocoTestReport -DincludeTags="ApiTest"


Upload-Test-Report:
needs:
- Unit-Tests
- End-To-End-Tests
- Component-Tests

permissions:
checks: write
pull-requests: write

runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: "**/test-results/**/*.xml"

Upload-Coverage-Report-To-Codecov:
needs:
- Unit-Tests
- Component-Tests
- API-Tests
runs-on: ubuntu-latest
if: always()
steps:
# Sources are needed for Codecov report
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: CodeCov
uses: codecov/codecov-action@v3
run: ./gradlew test -DincludeTags="ApiTest"
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ edc-dpf-client = { module = "org.eclipse.edc:data-plane-client", version.ref = "
edc-dpf-selector-client = { module = "org.eclipse.edc:data-plane-selector-client", version.ref = "edc" }
edc-dpf-selector-core = { module = "org.eclipse.edc:data-plane-selector-core", version.ref = "edc" }
edc-dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" }
edc-http = { module = "org.eclipse.edc:http", version.ref = "edc" }
edc-iam-mock = { module = "org.eclipse.edc:iam-mock", version.ref = "edc" }
edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-keys-spi = { module = "org.eclipse.edc:keys-spi", version.ref = "edc" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation(libs.edc.control.plane.core)
implementation(libs.edc.control.plane.api.client)
implementation(libs.edc.dsp)
implementation(libs.edc.http)
implementation(libs.edc.configuration.filesystem)
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation(libs.edc.control.plane.core)
implementation(libs.edc.control.plane.api.client)
implementation(libs.edc.dsp)
implementation(libs.edc.http)
implementation(libs.edc.configuration.filesystem)
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
Expand Down

0 comments on commit eec75da

Please sign in to comment.