Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(r): Refactor CI configuration #1210

Merged
merged 27 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7e66b98
move R jobs to their own workflow
paleolimbot Oct 18, 2023
1ca6347
simplify job
paleolimbot Oct 18, 2023
2600dfb
remove comment
paleolimbot Oct 18, 2023
6e0e2ea
better job name
paleolimbot Oct 18, 2023
1905ae2
maybe drop an extra compilation step
paleolimbot Oct 18, 2023
d7a6c53
see if we can simplify a bit more
paleolimbot Oct 18, 2023
98729c4
a few more tweaks
paleolimbot Oct 18, 2023
b97660c
add extended jobs
paleolimbot Oct 18, 2023
3973603
remove workflow dispatch
paleolimbot Oct 18, 2023
aae8300
typo
paleolimbot Oct 18, 2023
8080892
fix typo
paleolimbot Oct 18, 2023
36cacb0
tweak versions, don't fail fast on extended jobs
paleolimbot Oct 19, 2023
9562397
fix spelling of adbcflightsql
paleolimbot Oct 19, 2023
0ad172e
one more misspelling of adbc
paleolimbot Oct 19, 2023
4315aa4
maybe valgrind
paleolimbot Oct 19, 2023
ace33e0
Better name
paleolimbot Oct 19, 2023
01eab3c
fix valgrin check
paleolimbot Oct 19, 2023
419674a
better valgrind ci, remove unneded steps
paleolimbot Oct 19, 2023
81db274
better names
paleolimbot Oct 19, 2023
f8d4393
don't test Go-based drivers on valgrind
paleolimbot Oct 19, 2023
33fdd2b
remove GITHUB_PAT
paleolimbot Oct 20, 2023
a4e062f
give the whole reusable workflow thing a go
paleolimbot Oct 20, 2023
3403d9d
declar snowflake uri secret
paleolimbot Oct 20, 2023
fbf7829
use reusable workflow in r-extended
paleolimbot Oct 20, 2023
44b0aec
refine which checks get run and when
paleolimbot Oct 20, 2023
def541f
remove unneeded arg
paleolimbot Oct 20, 2023
92f861f
remove other unneded args
paleolimbot Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 0 additions & 105 deletions .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ on:
- "glib/**"
- "go/**"
- "python/**"
- "r/**"
- "ruby/**"
- ".github/workflows/native-unix.yml"
push:
Expand All @@ -41,7 +40,6 @@ on:
- "glib/**"
- "go/**"
- "python/**"
- "r/**"
- "ruby/**"
- ".github/workflows/native-unix.yml"

Expand Down Expand Up @@ -583,106 +581,3 @@ jobs:
ADBC_POSTGRESQL_TEST_URI: "postgres://localhost:5432/postgres?user=postgres&password=password"
run: |
pytest -vvs docs/source/tests/

# ------------------------------------------------------------
# R
# ------------------------------------------------------------
r:
name: "R-${{ matrix.config.r }}/${{ matrix.config.pkg }} (${{ matrix.config.os }})"
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: macOS-latest, r: 'release', pkg: 'adbcdrivermanager'}
- {os: windows-latest, r: 'release', pkg: 'adbcdrivermanager'}
- {os: ubuntu-latest, r: 'release', pkg: 'adbcdrivermanager'}
- {os: macOS-latest, r: 'release', pkg: 'adbcsqlite'}
- {os: windows-latest, r: 'release', pkg: 'adbcsqlite'}
- {os: ubuntu-latest, r: 'release', pkg: 'adbcsqlite'}
- {os: macOS-latest, r: 'release', pkg: 'adbcpostgresql'}
- {os: windows-latest, r: 'release', pkg: 'adbcpostgresql'}
- {os: windows-latest, r: '3.6', pkg: 'adbcpostgresql'}
- {os: ubuntu-latest, r: 'release', pkg: 'adbcpostgresql'}
- {os: macOS-latest, r: 'release', pkg: 'adbcsnowflake'}
- {os: windows-latest, r: 'release', pkg: 'adbcsnowflake'}
- {os: ubuntu-latest, r: 'release', pkg: 'adbcsnowflake'}
- {os: ubuntu-latest, r: 'release', pkg: 'adbcflightsql'}
- {os: macOS-latest, r: 'release', pkg: 'adbcflightsql'}
- {os: windows-latest, r: 'release', pkg: 'adbcflightsql'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Set PKG_CONFIG_PATH on MacOS
if: matrix.config.pkg == 'adbcpostgresql' && runner.os == 'macOS'
run: |
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libpq)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV

- name: Prepare sources (driver manager)
if: matrix.config.pkg == 'adbcdrivermanager'
run: |
R -e "install.packages('nanoarrow', repos = 'https://cloud.r-project.org')"
R CMD INSTALL r/${{ matrix.config.pkg }}
shell: bash

- name: Prepare sources
if: matrix.config.pkg != 'adbcdrivermanager'
run: |
R -e "install.packages('nanoarrow', repos = 'https://cloud.r-project.org')"
R CMD INSTALL r/adbcdrivermanager
R CMD INSTALL r/${{ matrix.config.pkg }}
shell: bash

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::../adbcdrivermanager
needs: check
working-directory: r/${{ matrix.config.pkg }}

- name: Start postgres test database
if: matrix.config.pkg == 'adbcpostgresql' && runner.os == 'Linux'
run: |
cd r/adbcpostgresql
docker compose up --detach postgres-test
ADBC_POSTGRESQL_TEST_URI="postgresql://localhost:5432/postgres?user=postgres&password=password"
echo "ADBC_POSTGRESQL_TEST_URI=${ADBC_POSTGRESQL_TEST_URI}" >> $GITHUB_ENV

- name: Start FlightSQL test database
if: matrix.config.pkg == 'adbcflightsql' && runner.os == 'Linux'
run: |
cd r/adbcpostgresql
docker compose up --detach flightsql-sqlite-test
ADBC_FLIGHTSQL_TEST_URI="grpc://localhost:8080"
echo "ADBC_FLIGHTSQL_TEST_URI=${ADBC_FLIGHTSQL_TEST_URI}" >> $GITHUB_ENV

- uses: r-lib/actions/check-r-package@v2
env:
ADBC_SNOWFLAKE_TEST_URI: ${{ secrets.SNOWFLAKE_URI }}
with:
upload-snapshots: true
working-directory: r/${{ matrix.config.pkg }}
# Using --no-multiarch here means that in version of R that support
# 32-bit Windows builds, only the 64-bit version is tested. With some
# effort we could also test 32-bit builds; however, they are not commonly
# used.
args: 'c("--no-manual", "--as-cran", "--no-multiarch")'

- name: Stop test database
if: runner.os == 'Linux'
run: |
docker compose down
53 changes: 53 additions & 0 deletions .github/workflows/r-basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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: R

# Runs on every PR that touches something the R package might use
on:
pull_request:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "go/adbc/driver/**"
- "go/adbc/pkg/**"
- "r/**"
- ".github/workflows/r-basic.yml"
- ".github/workflows/r-check.yml"

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read

jobs:
check:
strategy:
matrix:
os: [ubuntu]
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake]

uses: ./.github/workflows/r-check.yml
with:
os: ${{ matrix.os }}
pkg: ${{ matrix.pkg }}
secrets:
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
87 changes: 87 additions & 0 deletions .github/workflows/r-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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.

# Reusable check for various combinations of (pkg, os, rversion)
name: R

on:
workflow_call:
inputs:
os:
required: true
type: string
pkg:
required: true
type: string
rversion:
required: false
default: release
type: string
secrets:
SNOWFLAKE_URI:
required: false

jobs:
r-check:
runs-on: ${{ inputs.os }}-latest

steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- name: Set PKG_CONFIG_PATH on MacOS
if: inputs.pkg == 'adbcpostgresql' && runner.os == 'macOS'
run: |
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libpq)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::../adbcdrivermanager
needs: check
working-directory: r/${{ inputs.pkg }}

- name: Start postgres test database
if: inputs.pkg == 'adbcpostgresql' && runner.os == 'Linux'
run: |
cd r/adbcpostgresql
docker compose up --detach postgres-test
ADBC_POSTGRESQL_TEST_URI="postgresql://localhost:5432/postgres?user=postgres&password=password"
echo "ADBC_POSTGRESQL_TEST_URI=${ADBC_POSTGRESQL_TEST_URI}" >> $GITHUB_ENV

- name: Start FlightSQL test database
if: inputs.pkg == 'adbcflightsql' && runner.os == 'Linux'
run: |
cd r/adbcpostgresql
docker compose up --detach flightsql-sqlite-test
ADBC_FLIGHTSQL_TEST_URI="grpc://localhost:8080"
echo "ADBC_FLIGHTSQL_TEST_URI=${ADBC_FLIGHTSQL_TEST_URI}" >> $GITHUB_ENV

- uses: r-lib/actions/check-r-package@v2
env:
ADBC_SNOWFLAKE_TEST_URI: ${{ secrets.SNOWFLAKE_URI }}
R_KEEP_PKG_SOURCE: yes
with:
working-directory: r/${{ inputs.pkg }}

- name: Shutdown docker compose services
if: runner.os == 'Linux'
run: |
docker compose down
Loading
Loading