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 812cab4
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 247 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"
Loading

0 comments on commit 812cab4

Please sign in to comment.