Skip to content

Commit

Permalink
ci: launch test workflow also on release and bugfix branches (#422)
Browse files Browse the repository at this point in the history
* ci: launch test workflow also on release and bugfix branches

* cleanup
  • Loading branch information
ndr-brt authored Aug 22, 2024
1 parent d0c0335 commit f96f264
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 246 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 @@ -47,11 +47,8 @@ jobs:
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
80 changes: 0 additions & 80 deletions .github/workflows/release-tech-aws.yml

This file was deleted.

111 changes: 12 additions & 99 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,16 @@ 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/**'
- 'CODEOWNERS'
- 'LICENSE'

env:
VERSION: ${{ github.event.inputs.version || inputs.version }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -36,103 +23,29 @@ jobs:
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 checkstyleTestFixtures

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

End-To-End-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: End to End Integration Tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
with:
command: ./gradlew test -DincludeTags="EndToEndTest"

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

permissions:
checks: write
pull-requests: write

runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
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
- End-To-End-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@v4
with:
path: artifacts
- name: CodeCov
uses: codecov/codecov-action@v4
- name: End to End Tests
run: ./gradlew test -DincludeTags="EndToEndTest"

0 comments on commit f96f264

Please sign in to comment.