Skip to content

Add GitHub Actions workflow to build repro-cassandra jar #7

Add GitHub Actions workflow to build repro-cassandra jar

Add GitHub Actions workflow to build repro-cassandra jar #7

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}"