add triggers #3
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
name: R | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
push: | |
pull_request: | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
jobs: | |
rstats-linux: | |
name: R Package Linux | |
runs-on: ubuntu-20.04 | |
env: | |
LIBARROW_BINARY: 'false' | |
ARROW_USER_SIMD_LEVEL: 'AVX2' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'devel' | |
- name: Install | |
env: | |
GITHUB_PAT: ${{ github.token }} | |
shell: bash | |
run: | | |
sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build texlive-latex-base texlive-fonts-extra libcurl4-openssl-dev valgrind pandoc tidy | |
mkdir -p $HOME/.R | |
R -f dependencies.R | |
- name: Prepare | |
shell: bash | |
run: | | |
mkdir -p /tmp/duckdb_extensions | |
./configure | |
R CMD build . | |
- name: Tests | |
shell: bash | |
run: | | |
ls /tmp/duckdb_extensions | |
R CMD INSTALL -d duckdb_*.tar.gz | |
(cd tests && R -f testthat.R) | |
- name: R CMD check | |
shell: bash | |
run: | | |
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --as-cran -o /tmp duckdb_*.tar.gz | |
if egrep 'NOTE|WARNING|ERROR' /tmp/duckdb.Rcheck/00check.log ; then exit 1; fi | |
- name: Print R log (1) | |
# Print logs now only if success, for the case of failure there's another identical step below. | |
if: ${{ success() }} | |
shell: bash | |
run: | | |
cat /tmp/duckdb.Rcheck/00check.log | |
find /tmp/duckdb.Rcheck/ -type f -name "*.Rout*" -print0 | tee /dev/stderr | xargs -0 cat | |
- name: Valgrind | |
shell: bash | |
run: | | |
export NOT_CRAN='false' | |
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --use-valgrind -o /tmp duckdb_*.tar.gz | |
- name: Print check directory tree | |
if: ${{ always() }} | |
shell: bash | |
run: | | |
ls -R /tmp/duckdb.Rcheck | |
- name: Print R log (2) | |
if: ${{ always() }} | |
shell: bash | |
run: | | |
cat /tmp/duckdb.Rcheck/00check.log | |
find /tmp/duckdb.Rcheck/ -type f -name "*.Rout*" -print0 | tee /dev/stderr | xargs -0 cat | |
- name: Coverage | |
env: | |
DUCKDB_R_DEBUG: 1 | |
shell: Rscript {0} | |
run: | | |
pkgload::load_all(".") | |
cov <- covr::codecov(".", relative_path = ".") | |
- name: Deploy | |
shell: bash | |
run: python duckdb/scripts/asset-upload-gha.py duckdb_*.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: r-package-source | |
path: | | |
duckdb_*.tar.gz | |
rstats-linux-debug: | |
name: R Package Linux debug mode | |
runs-on: ubuntu-20.04 | |
needs: rstats-linux | |
env: | |
LIBARROW_BINARY: 'false' | |
ARROW_USER_SIMD_LEVEL: 'AVX2' | |
DUCKDB_R_DEBUG: 1 | |
DUCKDB_DEBUG_MOVE: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'devel' | |
- name: Install | |
env: | |
GITHUB_PAT: ${{ github.token }} | |
shell: bash | |
run: | | |
sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build libcurl4-openssl-dev | |
mkdir -p $HOME/.R | |
R -f dependencies.R | |
- name: Setup Ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{ github.job }} | |
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }} | |
- name: Build | |
shell: bash | |
run: | | |
./configure | |
R CMD INSTALL . | |
rstats-windows: | |
# Builds binaries for windows_amd64_rtools | |
name: R Package Windows | |
needs: rstats-linux | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'devel' | |
update-rtools: true | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup Ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{ github.job }} | |
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }} | |
- name: Install | |
shell: bash | |
run: | | |
R -f dependencies.R | |
- name: Build | |
shell: bash | |
run: | | |
./configure | |
R CMD build . | |
R CMD INSTALL duckdb_*.tar.gz | |
(cd tests && R -f testthat.R) | |
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --as-cran --no-manual -o /tmp duckdb_*.tar.gz | |
if egrep 'NOTE|WARNING|ERROR' /tmp/duckdb.Rcheck/00check.log ; then exit 1; fi | |
rstats-windows-extensions: | |
# Builds extensions for windows_amd64_rtools | |
name: R Package Windows (Extensions) | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
needs: rstats-linux | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'devel' | |
update-rtools: true | |
rtools-version: '42' # linker bug in 43 ^^ | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup Ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{ github.job }} | |
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }} | |
- uses: ./.github/actions/build_extensions | |
with: | |
deploy_as: windows_amd64_rtools | |
treat_warn_as_error: 0 | |
s3_id: ${{ secrets.S3_ID }} | |
s3_key: ${{ secrets.S3_KEY }} | |
signing_pk: ${{ secrets.DUCKDB_EXTENSION_SIGNING_PK }} | |
override_cc: gcc | |
override_cxx: g++ | |
openssl_path: C:/rtools43/x86_64-w64-mingw32.static.posix # not sure if this is required, there seems to be an openssl there | |
run_tests: 0 | |
build_out_of_tree_extensions: 0 | |
vcpkg_build: 0 | |
no_static_linking: 1 | |
- name: Install R package | |
shell: bash | |
run: | | |
R -e 'install.packages("DBI", repos = "https://cloud.r-project.org")' | |
./configure | |
R CMD build . | |
R CMD INSTALL duckdb_*.tar.gz | |
- name: Test Load | |
shell: bash | |
run: | | |
R -e 'con <- DBI::dbConnect(duckdb::duckdb(config = list("allow_unsigned_extensions" = "true")), debug=TRUE); lapply(Sys.glob("build/release/extension/*/*.duckdb_extension"), function(x) DBI::dbExecute(con, sprintf("LOAD \"%s\"", x))); DBI::dbDisconnect(con, shutdown=TRUE);' |