Fix and update combinations to tests #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# | |
# See https://github.com/r-lib/actions/tree/master/examples#readme for | |
# additional example workflows available for the R community. | |
name: ci-tests | |
on: | |
push: | |
branches: [ "feature/google_bigquery_connector" ] | |
pull_request: | |
branches: [ "feature/google_bigquery_connector" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.config.os-name }}-${{ matrix.config.os-version }} | |
name: >- | |
${{ matrix.config.os-name }}-${{ matrix.config.os-version }} | |
R ${{ matrix.config.r-version}} - Java ${{ matrix.config.java}} | |
Spark ${{ matrix.config.spark }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# Spark 3.5 seems currently unavailable so we use 3.4 for now | |
- os-name: ubuntu | |
os-version: latest | |
java: 17 | |
spark: "3.4" | |
r-version: release | |
- os-name: ubuntu | |
os-version: latest | |
java: 8 | |
spark: "2.4" | |
r-version: devel | |
- os-name: ubuntu | |
os-version: "22.04" | |
java: 11 | |
spark: "3.0" | |
r-version: oldrel | |
- os-name: macos | |
os-version: latest | |
java: 8 | |
spark: "3.2" | |
r-version: release | |
- os-name: macos | |
os-version: latest | |
java: 17 | |
spark: "3.4" | |
r-version: devel | |
- os-name: windows | |
os-version: latest | |
java: 8 | |
spark: "3.1" | |
r-version: oldrel | |
- os-name: windows | |
os-version: "2022" | |
java: 17 | |
spark: "3.3" | |
r-version: release | |
env: | |
SPARK_VERSION: ${{ matrix.config.spark }} | |
BILLING_PROJECT_ID: ${{ secrets.GCLOUD_BILLING_PROJECT_ID }} | |
MATERIALIZATION_DATASET: test | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/adc.json | |
R_DEFAULT_INTERNET_TIMEOUT: 1200 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4.4.0 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.config.java }} | |
java-package: jdk | |
architecture: x64 | |
- name: Print effective Java version | |
run: java -version | |
- name: Set up R ${{ matrix.r-version }} | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r-version }} | |
use-public-rspm: true | |
- name: Print effective R version | |
run: version | |
shell: Rscript {0} | |
- name: R CMD javareconf | |
if: runner.os != 'Windows' | |
run: | | |
java -version | |
echo java_home:$JAVA_HOME | |
echo library paths: $LD_LIBRARY_PATH | |
sudo R CMD javareconf JAVA_HOME=$JAVA_HOME | |
- name: Install and cache dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: ${{ matrix.config.java }} | |
extra-packages: | | |
any::rcmdcheck | |
- name: Install Spark | |
run: | | |
sparklyr::spark_install(version="${{ matrix.config.spark }}") | |
shell: Rscript {0} | |
- name: Set Google application default credentials | |
env: | |
ADC: ${{ secrets.GCLOUD_APPLICATION_CREDENTIALS }} | |
shell: bash | |
run: | | |
echo $ADC > $GOOGLE_APPLICATION_CREDENTIALS | |
- name: Run R CMD check | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
error-on: '"error"' | |
check-dir: '"check"' | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ matrix.config.os-name }}${{matrix.config.os-version}}-Java${{ matrix.config.java }}-R${{ matrix.config.r-version }}-Spark${{ matrix.config.spark }}-results | |
path: | | |
check/sparkbq.Rcheck/ | |
!check/sparkbq.Rcheck/00_pkg_src/ | |
!adc.json | |
- name: Upload successfully built package | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ matrix.config.os-name }}${{matrix.config.os-version}}-Java${{ matrix.config.java }}-R${{ matrix.config.r-version }}-Spark${{ matrix.config.spark }}-results | |
path: | | |
check/sparkbq_*.tar.gz | |
!adc.json |