|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + pull-requests: read |
| 17 | + |
| 18 | +jobs: |
| 19 | + unit-tests: |
| 20 | + name: Unit tests |
| 21 | + runs-on: ubuntu-latest |
| 22 | + timeout-minutes: 10 |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + persist-credentials: false |
| 27 | + - name: Setup Java |
| 28 | + uses: actions/setup-java@v4 |
| 29 | + with: |
| 30 | + distribution: temurin |
| 31 | + java-version: 21 |
| 32 | + cache: maven |
| 33 | + - name: Run unit tests |
| 34 | + run: bash ./mvnw -q -Dtest=*UnitTest test |
| 35 | + |
| 36 | + integration-tests: |
| 37 | + name: Integration tests |
| 38 | + runs-on: ubuntu-latest |
| 39 | + timeout-minutes: 10 |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + persist-credentials: false |
| 44 | + - name: Setup Java |
| 45 | + uses: actions/setup-java@v4 |
| 46 | + with: |
| 47 | + distribution: temurin |
| 48 | + java-version: 21 |
| 49 | + cache: maven |
| 50 | + - name: Run integration tests |
| 51 | + run: bash ./mvnw -q -Dtest=*IntegrationTest test |
| 52 | + |
| 53 | + ui-tests: |
| 54 | + name: UI tests |
| 55 | + runs-on: ubuntu-latest |
| 56 | + timeout-minutes: 10 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + persist-credentials: false |
| 61 | + - name: Setup Java |
| 62 | + uses: actions/setup-java@v4 |
| 63 | + with: |
| 64 | + distribution: temurin |
| 65 | + java-version: 21 |
| 66 | + cache: maven |
| 67 | + - name: Run UI tests |
| 68 | + env: |
| 69 | + JAVA_TOOL_OPTIONS: -Djava.awt.headless=true |
| 70 | + run: bash ./mvnw -q -Dtest=*UiTest test |
| 71 | + |
| 72 | + contract-and-smoke-tests: |
| 73 | + name: Contract & smoke tests |
| 74 | + runs-on: ubuntu-latest |
| 75 | + timeout-minutes: 10 |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + with: |
| 79 | + persist-credentials: false |
| 80 | + - name: Setup Java |
| 81 | + uses: actions/setup-java@v4 |
| 82 | + with: |
| 83 | + distribution: temurin |
| 84 | + java-version: 21 |
| 85 | + cache: maven |
| 86 | + - name: Run contract and smoke tests |
| 87 | + run: bash ./mvnw -q -Dtest='*ContractTest,*SmokeTest' test |
| 88 | + |
| 89 | + architecture-tests: |
| 90 | + name: Architecture tests |
| 91 | + runs-on: ubuntu-latest |
| 92 | + timeout-minutes: 10 |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + with: |
| 96 | + persist-credentials: false |
| 97 | + - name: Setup Java |
| 98 | + uses: actions/setup-java@v4 |
| 99 | + with: |
| 100 | + distribution: temurin |
| 101 | + java-version: 21 |
| 102 | + cache: maven |
| 103 | + - name: Run architecture tests |
| 104 | + run: bash ./mvnw -q -Dtest=ArchitectureUnitTest test |
| 105 | + |
| 106 | + quality-gate: |
| 107 | + name: Quality and coverage |
| 108 | + runs-on: ubuntu-latest |
| 109 | + timeout-minutes: 20 |
| 110 | + needs: |
| 111 | + - unit-tests |
| 112 | + - integration-tests |
| 113 | + - ui-tests |
| 114 | + - contract-and-smoke-tests |
| 115 | + - architecture-tests |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v4 |
| 118 | + with: |
| 119 | + persist-credentials: false |
| 120 | + - name: Setup Java |
| 121 | + uses: actions/setup-java@v4 |
| 122 | + with: |
| 123 | + distribution: temurin |
| 124 | + java-version: 21 |
| 125 | + cache: maven |
| 126 | + - name: Build and enforce quality gates |
| 127 | + run: bash ./mvnw -q verify |
| 128 | + - name: Upload coverage |
| 129 | + uses: codecov/codecov-action@v4 |
| 130 | + with: |
| 131 | + files: target/site/jacoco/jacoco.xml |
| 132 | + fail_ci_if_error: false |
| 133 | + |
| 134 | + static-analysis: |
| 135 | + name: Static checks |
| 136 | + runs-on: ubuntu-latest |
| 137 | + timeout-minutes: 15 |
| 138 | + steps: |
| 139 | + - uses: actions/checkout@v4 |
| 140 | + with: |
| 141 | + persist-credentials: false |
| 142 | + - name: Setup Java |
| 143 | + uses: actions/setup-java@v4 |
| 144 | + with: |
| 145 | + distribution: temurin |
| 146 | + java-version: 21 |
| 147 | + cache: maven |
| 148 | + - name: Checkstyle |
| 149 | + run: bash ./mvnw -q checkstyle:check |
| 150 | + - name: SpotBugs |
| 151 | + run: bash ./mvnw -q -DskipTests compile spotbugs:check |
| 152 | + - name: Secret scan |
| 153 | + run: | |
| 154 | + if git grep -n --ignore-case -E 'DROPBOX_ACCESS_TOKEN[[:space:]]*=[[:space:]]*"' src/main/java src/test/java; then |
| 155 | + echo "Hardcoded credential detected" |
| 156 | + exit 1 |
| 157 | + fi |
| 158 | + - name: Dependency review |
| 159 | + if: github.event_name == 'pull_request' |
| 160 | + uses: actions/dependency-review-action@v4 |
| 161 | + with: |
| 162 | + fail-on-severity: moderate |
| 163 | + - name: Dependency analysis |
| 164 | + run: bash ./mvnw -q -DskipTests -DfailOnWarning=false dependency:analyze-only |
| 165 | + - name: Maven validate |
| 166 | + run: bash ./mvnw -q -DskipTests validate |
0 commit comments