|
| 1 | +name: arrow flight tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +env: |
| 7 | + CONTINUOUS_INTEGRATION: true |
| 8 | + MAVEN_OPTS: "-Xmx1024M -XX:+ExitOnOutOfMemoryError" |
| 9 | + MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError" |
| 10 | + MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all --no-transfer-progress -Dmaven.javadoc.skip=true" |
| 11 | + MAVEN_TEST: "-B -Dair.check.skip-all -Dmaven.javadoc.skip=true -DLogTestDurationListener.enabled=true --no-transfer-progress --fail-at-end" |
| 12 | + RETRY: .github/bin/retry |
| 13 | + |
| 14 | +jobs: |
| 15 | + changes: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + pull-requests: read |
| 19 | + outputs: |
| 20 | + codechange: ${{ steps.filter.outputs.codechange }} |
| 21 | + steps: |
| 22 | + - uses: dorny/paths-filter@v2 |
| 23 | + id: filter |
| 24 | + with: |
| 25 | + filters: | |
| 26 | + codechange: |
| 27 | + - '!presto-docs/**' |
| 28 | + test: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + needs: changes |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + modules: |
| 35 | + - ":presto-base-arrow-flight" # Only run tests for the `presto-base-arrow-flight` module |
| 36 | + |
| 37 | + timeout-minutes: 80 |
| 38 | + concurrency: |
| 39 | + group: ${{ github.workflow }}-test-${{ matrix.modules }}-${{ github.event.pull_request.number }} |
| 40 | + cancel-in-progress: true |
| 41 | + |
| 42 | + steps: |
| 43 | + # Checkout the code only if there are changes in the relevant files |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + if: needs.changes.outputs.codechange == 'true' |
| 46 | + with: |
| 47 | + show-progress: false |
| 48 | + |
| 49 | + # Set up Java for the build environment |
| 50 | + - uses: actions/setup-java@v2 |
| 51 | + if: needs.changes.outputs.codechange == 'true' |
| 52 | + with: |
| 53 | + distribution: 'temurin' |
| 54 | + java-version: 8 |
| 55 | + |
| 56 | + # Cache Maven dependencies to speed up the build |
| 57 | + - name: Cache local Maven repository |
| 58 | + if: needs.changes.outputs.codechange == 'true' |
| 59 | + id: cache-maven |
| 60 | + uses: actions/cache@v2 |
| 61 | + with: |
| 62 | + path: ~/.m2/repository |
| 63 | + key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }} |
| 64 | + restore-keys: | |
| 65 | + ${{ runner.os }}-maven-2- |
| 66 | +
|
| 67 | + # Resolve Maven dependencies (if cache is not found) |
| 68 | + - name: Populate Maven cache |
| 69 | + if: steps.cache-maven.outputs.cache-hit != 'true' && needs.changes.outputs.codechange == 'true' |
| 70 | + run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs |
| 71 | + |
| 72 | + # Install dependencies for the target module |
| 73 | + - name: Maven Install |
| 74 | + if: needs.changes.outputs.codechange == 'true' |
| 75 | + run: | |
| 76 | + export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}" |
| 77 | + ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl ${{ matrix.modules }} |
| 78 | +
|
| 79 | + # Run Maven tests for the target module |
| 80 | + - name: Maven Tests |
| 81 | + if: needs.changes.outputs.codechange == 'true' |
| 82 | + run: ./mvnw test ${MAVEN_TEST} -pl ${{ matrix.modules }} |
0 commit comments