Skip to content

ci: Add github action to publish docker images #37510

ci: Add github action to publish docker images

ci: Add github action to publish docker images #37510

name: ci
on: pull_request
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 1C -DskipTests -Dair.check.skip-all --no-transfer-progress -Dmaven.javadoc.skip=true
RETRY: .github/bin/retry
jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
codechange: ${{ steps.filter.outputs.codechange }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
codechange:
- '!presto-docs/**'
product-tests-specific-environment1:
strategy:
fail-fast: false
matrix:
java: [17.0.15]
runs-on: ubuntu-latest
permissions:
contents: read
needs: changes
timeout-minutes: 60
concurrency:
group: ${{ github.workflow }}-product-tests-specific-environment1-${{ github.event.pull_request.number }}-${{ matrix.java }}
cancel-in-progress: true
steps:
- name: Free Disk Space
if: needs.changes.outputs.codechange == 'true'
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
docker-images: false
- uses: actions/checkout@v4
if: needs.changes.outputs.codechange == 'true'
with:
show-progress: false
persist-credentials: false
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Download nodejs to maven cache
if: needs.changes.outputs.codechange == 'true'
run: .github/bin/download_nodejs
- name: Maven install
if: needs.changes.outputs.codechange == 'true'
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
./mvnw install ${MAVEN_FAST_INSTALL} -am -pl '!presto-docs,!presto-spark-package,!presto-spark-launcher,!presto-spark-testing,!presto-test-coverage'
- name: Product Tests Specific 1.1
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode -g hdfs_no_impersonation,avro,mixed_case
- name: Product Tests Specific 1.2
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-kerberos-hdfs-no-impersonation -g hdfs_no_impersonation
# temporarily disable this flaky run. see issue #20388 for details
# - name: Product Tests Specific 1.3
# run: presto-product-tests/bin/run_on_docker.sh singlenode-hdfs-impersonation -g storage_formats,cli,hdfs_impersonation
- name: Product Tests Specific 1.4
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-kerberos-hdfs-impersonation -g storage_formats,cli,hdfs_impersonation,authorization,hive_file_header
- name: Product Tests Specific 1.5
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-kerberos-hdfs-impersonation-cross-realm -g storage_formats,cli,hdfs_impersonation
- name: Product Tests Specific 1.6
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh multinode-tls-kerberos -g cli,group-by,join,tls
product-tests-specific-environment2:
strategy:
fail-fast: false
matrix:
java: [17.0.15]
runs-on: ubuntu-latest
permissions:
contents: read
needs: changes
timeout-minutes: 60
concurrency:
group: ${{ github.workflow }}-product-tests-specific-environment2-${{ github.event.pull_request.number }}-${{ matrix.java }}
cancel-in-progress: true
steps:
- name: Free Disk Space
if: needs.changes.outputs.codechange == 'true'
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
docker-images: false
- uses: actions/checkout@v4
if: needs.changes.outputs.codechange == 'true'
with:
show-progress: false
persist-credentials: false
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Download nodejs to maven cache
if: needs.changes.outputs.codechange == 'true'
run: .github/bin/download_nodejs
- name: Maven install
if: needs.changes.outputs.codechange == 'true'
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
./mvnw install ${MAVEN_FAST_INSTALL} -am -pl '!presto-docs,!presto-spark-package,!presto-spark-launcher,!presto-spark-testing,!presto-test-coverage'
- name: Product Tests Specific 2.1
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-ldap -g ldap -x simba_jdbc
- name: Product Tests Specific 2.2
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh multinode-tls -g smoke,cli,group-by,join,tls
- name: Product Tests Specific 2.3
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-mysql -g mysql_connector,mysql
- name: Product Tests Specific 2.4
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-postgresql -g postgresql_connector
- name: Product Tests Specific 2.5
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-cassandra -g cassandra
# temporarily disable this flaky run. see issue #20388 for details
# - name: Product Tests Specific 2.6
# run: presto-product-tests/bin/run_on_docker.sh singlenode-kerberos-hdfs-impersonation-with-wire-encryption -g storage_formats,cli,hdfs_impersonation,authorization
- name: Product Tests Specific 2.7
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-kafka -g kafka
- name: Product Tests Specific 2.8
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-sqlserver -g sqlserver
- name: Product Tests Specific 2.9
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-mysql-mixed-case-on -g mysql_connector,mysql_mixed_case
- name: Product Tests Specific 2.10
if: needs.changes.outputs.codechange == 'true'
env:
OVERRIDE_JDK_DIR: ${{ env.JAVA_HOME }}
run: presto-product-tests/bin/run_on_docker.sh singlenode-kerberos-hdfs-impersonation-with-wire-encryption-cipher-suites -g create_table