| # 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: Java CI with Maven |
| |
| on: |
| pull_request: |
| types: [opened] |
| branches: |
| - trunk |
| push: |
| branches: |
| - trunk |
| schedule: |
| - cron: '0 20 * * *' |
| jobs: |
| build: |
| |
| runs-on: ubuntu-latest |
| |
| env: |
| JAVA_OPTS: -Xmx3g |
| TEST_MODULES: "core,engine" |
| STANDARD_BUILD_OPTS: "-Dmaven.javadoc.skip=true -B -V" |
| PROFILES: "" # "-Ptravis" |
| SPARK_1_6: http://d3kbcqa49mib13.cloudfront.net/spark-1.6.3-bin-hadoop2.6.tgz |
| SPARK_2_0: http://d3kbcqa49mib13.cloudfront.net/spark-2.0.2-bin-hadoop2.7.tgz |
| SPARK_2_1: http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz |
| SPARK_2_3: https://archive.apache.org/dist/spark/spark-2.3.0/spark-2.3.0-bin-hadoop2.7.tgz |
| |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| fetch-depth: 10 |
| |
| - name: Set up JDK 1.8 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'adopt' |
| java-version: '8.0.392+8' |
| |
| - name: Cache Maven packages |
| uses: actions/cache@v2 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| |
| - name: Install dependencies |
| run: | |
| sudo apt-get update |
| sudo apt-get install ocl-icd-libopencl1 |
| wget https://github.com/viennacl/viennacl-dev/archive/release-1.7.1.zip |
| unzip -qq release-1.7.1.zip |
| sudo cp -r viennacl-dev-release-1.7.1/viennacl /usr/include/viennacl |
| sudo cp -r viennacl-dev-release-1.7.1/CL /usr/include/CL |
| sudo apt-get install openssh-client |
| sudo apt-get install openssh-server |
| ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa |
| cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys |
| |
| - name: Build with Maven |
| run: mvn clean package $STANDARD_BUILD_OPTS -DskipTests -DskipCli |
| |
| - name: Setup Spark |
| run: | |
| echo $SPARK_2_3 |
| wget $SPARK_2_3 |
| tar -xzf *tgz |
| spark*/sbin/start-all.sh |
| |
| - name: Run tests with Spark |
| run: mvn test -pl $TEST_MODULES $PROFILES -Dtest.spark.master=spark://localhost:7077 |