From a6f138bec415ca1fb804693cdcad6b9310985a0d Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Tue, 6 Feb 2024 13:37:03 +0900 Subject: [PATCH] Add GitHub Actions workflow to build repro-cassandra jar --- .github/workflows/trino-cassandra.yml | 61 +++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/trino-cassandra.yml diff --git a/.github/workflows/trino-cassandra.yml b/.github/workflows/trino-cassandra.yml new file mode 100644 index 000000000000..662340007c3a --- /dev/null +++ b/.github/workflows/trino-cassandra.yml @@ -0,0 +1,61 @@ +name: Build trino-cassandra + +on: + push: + branches: + - 'repro-*' + +env: + # An envar that signals to tests we are executing in the CI environment + CONTINUOUS_INTEGRATION: true + MAVEN_OPTS: "-Xmx1024M -XX:+ExitOnOutOfMemoryError" + MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError" + MAVEN_FAST_INSTALL: "-B -V --quiet -T C1 -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" + MAVEN_TEST: "-B -Dair.check.skip-all -Dmaven.javadoc.skip=true -DLogTestDurationListener.enabled=true --fail-at-end" + RETRY: .github/bin/retry + +jobs: + trino-cassandra: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ap-northeast-1 + role-to-assume: ${{ vars.ROLE_TO_ASSUME }} + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: corretto + java-version: 11 + - name: Cache local Maven repository + id: cache-maven + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven-2- + - name: Populate maven cache + if: steps.cache-maven.outputs.cache-hit != 'true' + run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies + - name: Maven Install + run: | + export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}" + ./mvnw install ${MAVEN_FAST_INSTALL} -am -pl plugin/trino-cassandra + - name: Upload trino-cassandra.jar to S3 + run: | + trino_cassandra_jar=trino-cassandra-$(yq .project.version pom.xml).jar + aws s3api put-object \ + --bucket ${{ vars.DEPLOY_S3_BUCKET }} \ + --key "${{ vars.DEPLOY_S3_KEY_PREFIX }}/${{ github.ref_name }}/${{ github.run_number }}/${trino_cassandra_jar}" \ + --body "./plugin/trino-cassandra/target/${trino_cassandra_jar}" + - name: Upload trino-cassandra-services.jar + run: | + trino_cassandra_services_jar=trino-cassandra-$(yq .project.version pom.xml)-services.jar + aws s3api put-object \ + --bucket ${{ vars.DEPLOY_S3_BUCKET }} \ + --key "${{ vars.DEPLOY_S3_KEY_PREFIX }}/${{ github.ref_name }}/${{ github.run_number }}/${trino_cassandra_services_jar}" \ + --body "./plugin/trino-cassandra/target/${trino_cassandra_services_jar}"