Skip to content

[CI] Upgrade to actions/cache v4 #225

[CI] Upgrade to actions/cache v4

[CI] Upgrade to actions/cache v4 #225

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Snowflake integration test with real snowflake env
on:
push:
branches:
- master
pull_request_target: # This is a dangerous operation. Only people who are within Wherobots organization should be able to trigger this PR.
types:
- opened
- synchronize
- reopened
env:
SNOWFLAKE_AUTH_METHOD: ${{vars.SNOWFLAKE_AUTH_METHOD}}
SNOWFLAKE_USER: ${{secrets.SNOWFLAKE_USER}}
SNOWFLAKE_PASSWORD: ${{secrets.SNOWFLAKE_PASSWORD}}
SNOWFLAKE_DB: ${{vars.SNOWFLAKE_DB}}
SNOWFLAKE_SCHEMA: ${{vars.SNOWFLAKE_SCHEMA}}
SNOWFLAKE_WAREHOUSE: ${{vars.SNOWFLAKE_WAREHOUSE}}
SNOWFLAKE_ROLE: ${{vars.SNOWFLAKE_ROLE}}
SNOWFLAKE_ACCOUNT: ${{vars.SNOWFLAKE_ACCOUNT}}
SNOWFLAKE_GEOTOOLS_VERSION: '1.5.1-28.2'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- run: mkdir snowflake-tester/tmp
- run: sudo apt-get update && sudo apt-get -y install wget
- run: wget https://repo1.maven.org/maven2/org/datasyslab/geotools-wrapper/${SNOWFLAKE_GEOTOOLS_VERSION}/geotools-wrapper-${SNOWFLAKE_GEOTOOLS_VERSION}.jar -O snowflake-tester/tmp/geotools-wrapper-${SNOWFLAKE_GEOTOOLS_VERSION}.jar
- run: mvn clean package -DskipTests -pl snowflake -am
- run: find snowflake/target -name sedona-snowflake-*.jar -exec cp {} snowflake-tester/tmp/ \;
- run: export SEDONA_VERSION=$(find snowflake/target -name "sedona-snowflake-*.jar" -not -name "*-javadoc.jar" | sed 's/.*sedona-snowflake-\(.*\)\.jar/\1/') && echo $SEDONA_VERSION && mvn test -P snowflake