Skip to content

Commit

Permalink
add snowflake and redshift to ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Dec 9, 2023
1 parent 77faf3f commit 82ca20b
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Postgres-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches: [main, master]

name: Postgres-test
name: postgres-test

jobs:
R-CMD-check:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/redshift-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: redshift-test

jobs:
R-CMD-check:
if: github.repository == 'darwin-eu/CDMConnector'
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: true
matrix:
config:
- {os: macOS-latest, r: 'release'}

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

steps:
- uses: actions/checkout@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: Install suggested packages
run: |
install.packages("DatabaseConnector")
install.packages("RPostgres")
install.packages("testthat")
shell: Rscript {0}

- name: Install CirceR
run: |
install.packages("rJava")
install.packages("RJSONIO")
install.packages("CirceR", repos = "https://OHDSI.github.io/drat", type = "source")
install.packages("Capr", repos = "https://OHDSI.github.io/drat", type = "source")
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: any::rcmdcheck
needs: check

- name: Run tests on redshift with RPostgres driver
run: |
withr::with_envvar(new = c("CI_TEST_DB" = "redshift"), testthat::test_local())
shell: Rscript {0}


59 changes: 59 additions & 0 deletions .github/workflows/snowflake-odbc-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: snowflake-odbc-test

jobs:
R-CMD-check:
if: github.repository == 'darwin-eu/CDMConnector'
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: true
matrix:
config:
- {os: macOS-latest, r: 'release'}

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

steps:
- uses: actions/checkout@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: Install suggested packages
run: |
install.packages("DatabaseConnector")
install.packages("testthat")
shell: Rscript {0}

- name: Install CirceR
run: |
install.packages("rJava")
install.packages("RJSONIO")
install.packages("CirceR", repos = "https://OHDSI.github.io/drat", type = "source")
install.packages("Capr", repos = "https://OHDSI.github.io/drat", type = "source")
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: any::rcmdcheck
needs: check

- name: Run tests on Snowflake with odbc driver
run: |
withr::with_envvar(new = c("CI_TEST_DB" = "snowflake"), testthat::test_local())
shell: Rscript {0}


3 changes: 1 addition & 2 deletions .github/workflows/sqlserver-odbc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- name: Install suggested packages
run: |
install.packages("DatabaseConnector")
install.packages("RPostgres")
install.packages("testthat")
shell: Rscript {0}

Expand All @@ -52,7 +51,7 @@ jobs:
extra-packages: any::rcmdcheck
needs: check

- name: Run tests on postgres
- name: Run tests on MS SQL Server with odbc
run: |
withr::with_envvar(new = c("CI_TEST_DB" = "sqlserver"), testthat::test_local())
shell: Rscript {0}
Expand Down
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ output: md_document
[![codecov.io](https://codecov.io/gh/OdyOSG/CDMConnector/coverage.svg?branch=main)](https://app.codecov.io/gh/OdyOSG/CDMConnector?branch=main)
[![Build Status](https://github.com/darwin-eu/CDMConnector/workflows/R-CMD-check/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3AR-CMD-check)
[![duckdb status](https://github.com/darwin-eu/CDMConnector/workflows/duckdb-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Aduckdb-test)
[![Postgres status](https://github.com/darwin-eu/CDMConnector/workflows/Postgres-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3APostgres-test)
[![Postgres status](https://github.com/darwin-eu/CDMConnector/workflows/postgres-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Apostgres-test)
[![SQL Server odbc status](https://github.com/darwin-eu/CDMConnector/workflows/sqlserver-odbc-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Asqlserver-odbc-test)
[![Redshift status](https://github.com/darwin-eu/CDMConnector/workflows/redshift-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Aredshift-test)
[![Snowflake status](https://github.com/darwin-eu/CDMConnector/workflows/snowflake-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Asnowflake-test)
<!-- badges: end -->


Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ Status](https://github.com/darwin-eu/CDMConnector/workflows/R-CMD-check/badge.sv
[![duckdb
status](https://github.com/darwin-eu/CDMConnector/workflows/duckdb-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Aduckdb-test)
[![Postgres
status](https://github.com/darwin-eu/CDMConnector/workflows/Postgres-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3APostgres-test)
status](https://github.com/darwin-eu/CDMConnector/workflows/postgres-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Apostgres-test)
[![SQL Server odbc
status](https://github.com/darwin-eu/CDMConnector/workflows/sqlserver-odbc-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Asqlserver-odbc-test)
[![Redshift
status](https://github.com/darwin-eu/CDMConnector/workflows/redshift-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Aredshift-test)
[![Snowflake
status](https://github.com/darwin-eu/CDMConnector/workflows/snowflake-test/badge.svg)](https://github.com/darwin-eu/CDMConnector/actions?query=workflow%3Asnowflake-test)
<!-- badges: end -->

> Are you using the [tidyverse](https://www.tidyverse.org/) with an OMOP
Expand Down Expand Up @@ -101,7 +105,7 @@ Use dplyr verbs with the table references.
tally(cdm$person)

## # Source: SQL [1 x 1]
## # Database: DuckDB 0.8.1 [root@Darwin 23.0.0:R 4.3.1//var/folders/xx/01v98b6546ldnm1rg1_bvk000000gn/T//RtmpWNJ7aT/file61f43b0c4a88.duckdb]
## # Database: DuckDB 0.8.1 [root@Darwin 23.0.0:R 4.3.1//var/folders/xx/01v98b6546ldnm1rg1_bvk000000gn/T//Rtmp921L2M/file627412c0268b.duckdb]
## n
## <dbl>
## 1 2694
Expand All @@ -113,7 +117,7 @@ Compose operations with the pipe.
count(top_conditions = concept_name, sort = TRUE)

## # Source: SQL [?? x 2]
## # Database: DuckDB 0.8.1 [root@Darwin 23.0.0:R 4.3.1//var/folders/xx/01v98b6546ldnm1rg1_bvk000000gn/T//RtmpWNJ7aT/file61f43b0c4a88.duckdb]
## # Database: DuckDB 0.8.1 [root@Darwin 23.0.0:R 4.3.1//var/folders/xx/01v98b6546ldnm1rg1_bvk000000gn/T//Rtmp921L2M/file627412c0268b.duckdb]
## # Ordered by: desc(n)
## top_conditions n
## <chr> <dbl>
Expand Down

0 comments on commit 82ca20b

Please sign in to comment.