|
| 1 | +name: Authorization Integration Test |
| 2 | + |
| 3 | +# Controls when the workflow will run |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events but only for the "main" branch |
| 6 | + push: |
| 7 | + branches: [ "main", "branch-*" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "main", "branch-*" ] |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + changes: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - uses: dorny/paths-filter@v2 |
| 21 | + id: filter |
| 22 | + with: |
| 23 | + filters: | |
| 24 | + source_changes: |
| 25 | + - .github/** |
| 26 | + - api/** |
| 27 | + - authorizations/** |
| 28 | + - bin/** |
| 29 | + - catalogs/** |
| 30 | + - clients/client-java/** |
| 31 | + - clients/client-java-runtime/** |
| 32 | + - clients/filesystem-hadoop3/** |
| 33 | + - clients/filesystem-hadoop3-runtime/** |
| 34 | + - common/** |
| 35 | + - conf/** |
| 36 | + - core/** |
| 37 | + - gradle/** |
| 38 | + - integration-test-common/** |
| 39 | + - iceberg/** |
| 40 | + - meta/** |
| 41 | + - server/** |
| 42 | + - server-common/** |
| 43 | + - trino-connector/** |
| 44 | + - web/** |
| 45 | + - build.gradle.kts |
| 46 | + - gradle.properties |
| 47 | + - gradlew |
| 48 | + - setting.gradle.kts |
| 49 | + outputs: |
| 50 | + source_changes: ${{ steps.filter.outputs.source_changes }} |
| 51 | + |
| 52 | + # Integration test for AMD64 architecture |
| 53 | + test-amd64-arch: |
| 54 | + needs: changes |
| 55 | + if: needs.changes.outputs.source_changes == 'true' |
| 56 | + runs-on: ubuntu-latest |
| 57 | + timeout-minutes: 60 |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + # Integration test for AMD64 architecture |
| 61 | + architecture: [linux/amd64] |
| 62 | + java-version: [ 8, 11, 17 ] |
| 63 | + test-mode: [ embedded, deploy ] |
| 64 | + include: |
| 65 | + - test-mode: 'embedded' |
| 66 | + backend: 'h2' |
| 67 | + - test-mode: 'deploy' |
| 68 | + backend: 'mysql' |
| 69 | + |
| 70 | + env: |
| 71 | + PLATFORM: ${{ matrix.architecture }} |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v3 |
| 74 | + |
| 75 | + - uses: actions/setup-java@v4 |
| 76 | + with: |
| 77 | + java-version: ${{ matrix.java-version }} |
| 78 | + distribution: 'temurin' |
| 79 | + cache: 'gradle' |
| 80 | + |
| 81 | + - name: Set up QEMU |
| 82 | + uses: docker/setup-qemu-action@v2 |
| 83 | + |
| 84 | + - name: Check required command |
| 85 | + run: | |
| 86 | + dev/ci/check_commands.sh |
| 87 | +
|
| 88 | + - name: Package Gravitino |
| 89 | + if : ${{ matrix.test-mode == 'deploy' }} |
| 90 | + run: | |
| 91 | + ./gradlew compileDistribution -x test -PjdkVersion=${{ matrix.java-version }} |
| 92 | +
|
| 93 | + - name: Free up disk space |
| 94 | + run: | |
| 95 | + dev/ci/util_free_space.sh |
| 96 | +
|
| 97 | + - name: Authorization Integration Test(JDK${{ matrix.java-version }}-${{ matrix.test-mode }}-${{ matrix.backend }}) |
| 98 | + id: integrationTest |
| 99 | + run: | |
| 100 | + ./gradlew -PskipTests -PtestMode=${{ matrix.test-mode }} -PjdbcBackend=${{ matrix.backend }} -PjdkVersion=${{ matrix.java-version }} -PskipDockerTests=false :authorizations:authorization-ranger:test --tests "org.apache.gravitino.authorization.ranger.integration.test.**" |
| 101 | +
|
| 102 | + - name: Upload integrate tests reports |
| 103 | + uses: actions/upload-artifact@v3 |
| 104 | + if: ${{ (failure() && steps.integrationTest.outcome == 'failure') || contains(github.event.pull_request.labels.*.name, 'upload log') }} |
| 105 | + with: |
| 106 | + name: authorizations-integrate-test-reports-${{ matrix.java-version }} |
| 107 | + path: | |
| 108 | + build/reports |
| 109 | + distribution/package/logs/gravitino-server.out |
| 110 | + distribution/package/logs/gravitino-server.log |
0 commit comments