| 1 | name: Run Tests |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | push: |
| 6 | pull_request: |
| 7 | branches: [ main, refactor/* ] |
| 8 | paths-ignore: |
| 9 | - "**.md" |
| 10 | - "docs/**" |
| 11 | - "CODEOWNERS" |
| 12 | - "LICENSE" |
| 13 | |
| 14 | concurrency: |
| 15 | group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | cancel-in-progress: true |
| 17 | |
| 18 | jobs: |
| 19 | Checkstyle: |
| 20 | permissions: |
| 21 | id-token: write |
| 22 | checks: write |
| 23 | pull-requests: write |
| 24 | runs-on: ubuntu-latest |
| 25 | steps: |
| 26 | - uses: actions/checkout@v4 |
| 27 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 28 | |
| 29 | - name: Run Checkstyle |
| 30 | run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures |
| 31 | |
| 32 | Javadoc: |
| 33 | runs-on: ubuntu-latest |
| 34 | steps: |
| 35 | - uses: actions/checkout@v4 |
| 36 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 37 | |
| 38 | - name: Run Javadoc |
| 39 | run: ./gradlew javadoc |
| 40 | |
| 41 | Unit-Tests: |
| 42 | runs-on: ubuntu-latest |
| 43 | env: |
| 44 | JACOCO: true |
| 45 | steps: |
| 46 | - uses: actions/checkout@v4 |
| 47 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 48 | |
| 49 | - name: Run unit tests |
| 50 | uses: eclipse-edc/.github/.github/actions/run-tests@main |
| 51 | with: |
| 52 | command: ./gradlew test jacocoTestReport |
| 53 | |
| 54 | Postgresql-Integration-Tests: |
| 55 | runs-on: ubuntu-latest |
| 56 | |
| 57 | services: |
| 58 | postgres: |
| 59 | image: postgres:14.2 |
| 60 | ports: |
| 61 | - 5432:5432 |
| 62 | env: |
| 63 | POSTGRES_PASSWORD: password |
| 64 | |
| 65 | steps: |
| 66 | - uses: actions/checkout@v4 |
| 67 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 68 | |
| 69 | - name: Postgresql Tests |
| 70 | uses: eclipse-edc/.github/.github/actions/run-tests@main |
| 71 | with: |
| 72 | command: ./gradlew test -DincludeTags="PostgresqlIntegrationTest" |
| 73 | |
| 74 | End-To-End-Tests: |
| 75 | runs-on: ubuntu-latest |
| 76 | steps: |
| 77 | - uses: actions/checkout@v4 |
| 78 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 79 | - name: End to End Integration Tests |
| 80 | uses: eclipse-edc/.github/.github/actions/run-tests@main |
| 81 | with: |
| 82 | command: ./gradlew test jacocoTestReport -DincludeTags="EndToEndTest" |
| 83 | |
| 84 | Component-Tests: |
| 85 | env: |
| 86 | JACOCO: true |
| 87 | runs-on: ubuntu-latest |
| 88 | steps: |
| 89 | - uses: actions/checkout@v4 |
| 90 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 91 | |
| 92 | - name: Component Tests |
| 93 | uses: eclipse-edc/.github/.github/actions/run-tests@main |
| 94 | with: |
| 95 | command: ./gradlew test jacocoTestReport -DincludeTags="ComponentTest" |
| 96 | |
| 97 | API-Tests: |
| 98 | env: |
| 99 | JACOCO: true |
| 100 | runs-on: ubuntu-latest |
| 101 | steps: |
| 102 | - uses: actions/checkout@v4 |
| 103 | - uses: eclipse-edc/.github/.github/actions/setup-build@main |
| 104 | |
| 105 | - name: Component Tests |
| 106 | uses: eclipse-edc/.github/.github/actions/run-tests@main |
| 107 | with: |
| 108 | command: ./gradlew test jacocoTestReport -DincludeTags="ApiTest" |
| 109 | |
| 110 | Upload-Test-Report: |
| 111 | needs: |
| 112 | - API-Tests |
| 113 | - Component-Tests |
| 114 | - End-To-End-Tests |
| 115 | - Postgresql-Integration-Tests |
| 116 | - Unit-Tests |
| 117 | |
| 118 | permissions: |
| 119 | checks: write |
| 120 | pull-requests: write |
| 121 | |
| 122 | runs-on: ubuntu-latest |
| 123 | if: always() |
| 124 | steps: |
| 125 | - name: Download Artifacts |
| 126 | uses: actions/download-artifact@v4 |
| 127 | with: |
| 128 | path: artifacts |
| 129 | - name: Publish Test Results |
| 130 | uses: EnricoMi/publish-unit-test-result-action@v2 |
| 131 | if: always() |
| 132 | with: |
| 133 | junit_files: "**/test-results/**/*.xml" |
| 134 | |
| 135 | Upload-Coverage-Report-To-Codecov: |
| 136 | needs: |
| 137 | - API-Tests |
| 138 | - Unit-Tests |
| 139 | - Component-Tests |
| 140 | - End-To-End-Tests |
| 141 | |
| 142 | runs-on: ubuntu-latest |
| 143 | if: always() |
| 144 | steps: |
| 145 | # Sources are needed for Codecov report |
| 146 | - uses: actions/checkout@v4 |
| 147 | - name: Download Artifacts |
| 148 | uses: actions/download-artifact@v4 |
| 149 | with: |
| 150 | path: artifacts |
| 151 | - name: CodeCov |
| 152 | uses: codecov/codecov-action@v4 |