Merge branch 'master' into cereal

Signed-off-by: Omar Shrit <omar@shrit.me>
This commit is contained in:
Omar Shrit
2020-10-03 12:58:14 +02:00
23 changed files with 895 additions and 563 deletions
+59 -1
View File
@@ -8,13 +8,31 @@ on:
- master
release:
types: [published, created, edited]
name: R CMD check mlpack
jobs:
cancel:
name: 'Cancel Previous Builds'
if: ${{ github.event_name == 'pull_request' && github.repository == 'mlpack/mlpack' }}
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Get all workflow ids and set to env variable
run: echo ::set-env name=WORKFLOW_IDS_TO_CANCEL::$(curl https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows -s | jq -r '.workflows | map(.id|tostring) | join(",")')
- uses: styfle/cancel-workflow-action@0.5.0
with:
workflow_id: ${{ env.WORKFLOW_IDS_TO_CANCEL }}
access_token: ${{ secrets.GITHUB_TOKEN }}
jobR:
name: mlpack-R
name: Build mlpack_r_tarball
if: ${{ github.repository == 'mlpack/mlpack' }}
runs-on: ubuntu-20.04
outputs:
r_bindings: ${{ steps.mlpack_version.outputs.mlpack_r_package }}
steps:
- uses: actions/checkout@v2
@@ -27,6 +45,23 @@ jobs:
MLPACK_VERSION_VALUE=${MLPACK_VERSION_MAJOR}.${MLPACK_VERSION_MINOR}.${MLPACK_VERSION_PATCH}
echo ::set-output name=mlpack_r_package::$(echo mlpack_"$MLPACK_VERSION_VALUE".tar.gz)
- uses: r-lib/actions/setup-r@master
with:
r-version: release
- name: Query dependencies
run: |
cp src/mlpack/bindings/R/mlpack/DESCRIPTION.in DESCRIPTION
Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds')"
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-release-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-release-
- name: Install Build Dependencies
run: |
sudo apt-get update
@@ -38,6 +73,12 @@ jobs:
sudo apt-get install -y r-base-core
sudo Rscript -e "install.packages(c('Rcpp', 'RcppArmadillo', 'RcppEnsmallen', 'BH', 'roxygen2', 'testthat', 'Rcereal'))"
- name: Install R-bindings dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("roxygen2")
shell: Rscript {0}
- name: CMake
run: |
mkdir build
@@ -58,6 +99,7 @@ jobs:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
if: ${{ github.repository == 'mlpack/mlpack' }}
strategy:
fail-fast: false
@@ -74,6 +116,8 @@ jobs:
R_CHECK_ARGS: "--no-build-vignettes"
_R_CHECK_FORCE_SUGGESTS: 0
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/download-artifact@v2
@@ -86,10 +130,24 @@ jobs:
- uses: r-lib/actions/setup-pandoc@master
- name: Query dependencies
run: Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps('${{ needs.jobR.outputs.r_bindings }}', dependencies = TRUE), 'depends.Rds')"
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-
- name: Install dependencies
run: |
Rscript -e "install.packages('remotes')" -e "remotes::install_cran('rcmdcheck')"
Rscript -e "install.packages(c('Rcpp', 'RcppArmadillo', 'RcppEnsmallen', 'BH', 'roxygen2', 'testthat', 'Rcereal'))"
remotes::install_deps('${{ needs.jobR.outputs.r_bindings }}', dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: Check
run: Rscript -e "rcmdcheck::rcmdcheck('${{ needs.jobR.outputs.r_bindings }}', args = c('--no-manual','--as-cran'), error_on = 'warning', check_dir = 'check')"