|
| 1 | +name: maven checks |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + |
| 7 | +env: |
| 8 | + # An envar that signals to tests we are executing in the CI environment |
| 9 | + CONTINUOUS_INTEGRATION: true |
| 10 | + MAVEN_OPTS: "-Xmx1024M -XX:+ExitOnOutOfMemoryError" |
| 11 | + MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError" |
| 12 | + RETRY: .github/bin/retry |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: "${{github.workflow}}-${{github.ref}}" |
| 16 | + |
| 17 | + # Cancel in-progress jobs for efficiency. Exclude the `release-0.293-clp-connector` branch so |
| 18 | + # that each commit to release-0.293-clp-connector is checked completely. |
| 19 | + cancel-in-progress: "${{github.ref != 'refs/heads/release-0.293-clp-connector'}}" |
| 20 | + |
| 21 | +jobs: |
| 22 | + maven-checks: |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + java: [ 8.0.442, 17.0.13 ] |
| 27 | + runs-on: ubuntu-latest |
| 28 | + timeout-minutes: 45 |
| 29 | + steps: |
| 30 | + - name: Free Disk Space |
| 31 | + run: | |
| 32 | + df -h |
| 33 | + sudo apt-get clean |
| 34 | + df -h |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + show-progress: false |
| 38 | + - uses: actions/setup-java@v4 |
| 39 | + with: |
| 40 | + distribution: 'temurin' |
| 41 | + java-version: ${{ matrix.java }} |
| 42 | + cache: 'maven' |
| 43 | + - name: Download nodejs to maven cache |
| 44 | + run: .github/bin/download_nodejs |
| 45 | + - name: Maven Checks |
| 46 | + run: | |
| 47 | + export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}" |
| 48 | + ./mvnw install -B -V -T 1C -DskipTests -Dmaven.javadoc.skip=true --no-transfer-progress -P ci -pl '!presto-test-coverage,!:presto-docs' |
| 49 | + - name: Upload presto-server tarball |
| 50 | + if: matrix.java == '8.0.442' |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: presto-server |
| 54 | + path: presto-server/target/presto-server-0.293.tar.gz |
| 55 | + - name: Upload presto-cli executable |
| 56 | + if: matrix.java == '8.0.442' |
| 57 | + uses: actions/upload-artifact@v4 |
| 58 | + with: |
| 59 | + name: presto-cli |
| 60 | + path: presto-cli/target/presto-cli-0.293-executable.jar |
| 61 | + - name: Clean Maven Output |
| 62 | + run: ./mvnw clean -pl '!:presto-server,!:presto-cli,!presto-test-coverage' |
| 63 | + |
| 64 | + presto-coordinator-runtime-image: |
| 65 | + name: presto-coordinator-runtime-image |
| 66 | + needs: maven-checks |
| 67 | + runs-on: ubuntu-22.04 |
| 68 | + if: ${{ always() && success() }} |
| 69 | + steps: |
| 70 | + - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" |
| 71 | + with: |
| 72 | + submodules: "recursive" |
| 73 | + |
| 74 | + - name: "Login to Image Registry" |
| 75 | + uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772" |
| 76 | + with: |
| 77 | + registry: ghcr.io |
| 78 | + username: ${{github.actor}} |
| 79 | + password: ${{secrets.GITHUB_TOKEN}} |
| 80 | + |
| 81 | + - name: Download presto-server |
| 82 | + uses: actions/download-artifact@v4 |
| 83 | + with: |
| 84 | + name: presto-server |
| 85 | + path: /tmp |
| 86 | + |
| 87 | + - name: Download presto-cli |
| 88 | + uses: actions/download-artifact@v4 |
| 89 | + with: |
| 90 | + name: presto-cli |
| 91 | + path: /tmp |
| 92 | + |
| 93 | + - name: "Run build.sh" |
| 94 | + working-directory: ./docker |
| 95 | + run: | |
| 96 | + mv /tmp/presto-server-0.293.tar.gz ./ |
| 97 | + mv /tmp/presto-cli-0.293-executable.jar ./ |
| 98 | + |
| 99 | + docker buildx create --name container --driver docker-container --use |
| 100 | + |
| 101 | + IMAGE_NAME=yscope-presto-with-clp-connector-coordinator \ |
| 102 | + REG_ORG=ghcr.io/${{github.actor}} \ |
| 103 | + PUBLISH=true \ |
| 104 | + ./build.sh 0.293 |
| 105 | + |
| 106 | + rm presto-server-0.293.tar.gz |
| 107 | + rm presto-cli-0.293-executable.jar |
0 commit comments