|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - v2 |
| 7 | + paths: |
| 8 | + - 'powertools-batch/**' |
| 9 | + - 'powertools-cloudformation/**' |
| 10 | + - 'powertools-common/**' |
| 11 | + - 'powertools-e2e-tests/**' |
| 12 | + - 'powertools-idempotency/**' |
| 13 | + - 'powertools-large-messages/**' |
| 14 | + - 'powertools-logging/**' |
| 15 | + - 'powertools-metrics/**' |
| 16 | + - 'powertools-parameters/**' |
| 17 | + - 'powertools-serialization/**' |
| 18 | + - 'powertools-tracing/**' |
| 19 | + - 'powertools-validation/**' |
| 20 | + - 'examples/**' |
| 21 | + - 'pom.xml' |
| 22 | + - 'examples/pom.xml' |
| 23 | + - '.github/workflows/**' |
| 24 | + push: |
| 25 | + branches: |
| 26 | + - v2 |
| 27 | + paths: |
| 28 | + - 'powertools-batch/**' |
| 29 | + - 'powertools-cloudformation/**' |
| 30 | + - 'powertools-common/**' |
| 31 | + - 'powertools-e2e-tests/**' |
| 32 | + - 'powertools-idempotency/**' |
| 33 | + - 'powertools-large-messages/**' |
| 34 | + - 'powertools-logging/**' |
| 35 | + - 'powertools-metrics/**' |
| 36 | + - 'powertools-parameters/**' |
| 37 | + - 'powertools-serialization/**' |
| 38 | + - 'powertools-tracing/**' |
| 39 | + - 'powertools-validation/**' |
| 40 | + - 'examples/**' |
| 41 | + - 'pom.xml' |
| 42 | + - 'examples/pom.xml' |
| 43 | + - '.github/workflows/**' |
| 44 | +jobs: |
| 45 | + build-corretto: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + max-parallel: 5 |
| 49 | + matrix: |
| 50 | + java: [11, 17, 21] |
| 51 | + name: Java ${{ matrix.java }} |
| 52 | + env: |
| 53 | + JAVA: ${{ matrix.java }} |
| 54 | + AWS_REGION: eu-west-1 |
| 55 | + permissions: |
| 56 | + id-token: write # needed to interact with GitHub's OIDC Token endpoint. |
| 57 | + contents: read |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 |
| 60 | + - name: Setup java |
| 61 | + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 |
| 62 | + with: |
| 63 | + distribution: 'corretto' |
| 64 | + java-version: ${{ matrix.java }} |
| 65 | + cache: 'maven' |
| 66 | + - name: Build with Maven |
| 67 | + run: mvn -B install --file pom.xml |
| 68 | + - name: Build Gradle Example - Java |
| 69 | + working-directory: examples/powertools-examples-core/gradle |
| 70 | + run: ./gradlew build |
| 71 | + - name: Build Gradle Example - Kotlin |
| 72 | + working-directory: examples/powertools-examples-core/kotlin |
| 73 | + run: ./gradlew build |
| 74 | + - name: Upload coverage to Codecov |
| 75 | + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 |
| 76 | + if: ${{ matrix.java == '11' }} # publish results once |
| 77 | + with: |
| 78 | + files: ./powertools-cloudformation/target/site/jacoco/jacoco.xml,./powertools-core/target/site/jacoco/jacoco.xml,./powertools-idempotency/target/site/jacoco/jacoco.xml,./powertools-logging/target/site/jacoco/jacoco.xml,./powertools-metrics/target/site/jacoco/jacoco.xml,./powertools-parameters/target/site/jacoco/jacoco.xml,./powertools-serialization/target/site/jacoco/jacoco.xml,./powertools-sqs/target/site/jacoco/jacoco.xml,./powertools-tracing/target/site/jacoco/jacoco.xml,./powertools-validation/target/site/jacoco/jacoco.xml,./powertools-large-messages/target/site/jacoco/jacoco.xml,./powertools-batch/target/site/jacoco/jacoco.xml |
| 79 | + savepr: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + name: Save PR number if running on PR by dependabot |
| 82 | + if: github.actor == 'dependabot[bot]' |
| 83 | + steps: |
| 84 | + - name: Create Directory and save issue |
| 85 | + run: | |
| 86 | + mkdir -p ./pr |
| 87 | + echo ${{ github.event.number }} |
| 88 | + echo ${{ github.event.number }} > ./pr/NR |
| 89 | + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 |
| 90 | + name: Upload artifact |
| 91 | + with: |
| 92 | + name: pr |
| 93 | + path: pr/ |
0 commit comments