Skip to content

submit-CRAN

submit-CRAN #635

name: submit-CRAN
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SAT'
env:
DEBUG_CI: true
jobs:
release:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
r-version: [ 'release', 'devel', 'oldrel-1' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
rtools-version: ''
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: false
extra-packages: any::devtools
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.24.x'
- name: R CMD build
shell: bash
env: # this alias helps to reuse following line as script
OS: ${{ matrix.os }}
run: |
pushd ..
R CMD build rlibkriging
mkdir rlibkriging/CRAN-$OS
mv rlibkriging_*.* rlibkriging/CRAN-$OS/.
popd
- name: Install dependencies for tests
shell: bash
run: |
Rscript --no-save ./tools/install_packages.R testthat DiceKriging
# Verify DiceKriging is properly installed
Rscript -e "if (!requireNamespace('DiceKriging', quietly = TRUE)) { stop('DiceKriging installation failed') } else { cat('DiceKriging version:', as.character(packageVersion('DiceKriging')), '\n') }"
- name: R CMD check
shell: bash
env:
OS: ${{ matrix.os }}
run: |
R CMD check --as-cran --no-manual CRAN-$OS/rlibkriging* || (
test -f rlibkriging.Rcheck/00install.out && cat rlibkriging.Rcheck/00install.out | sed -e 's/^/00install.out| /' && echo "[The error may be shown before 00install.out| listing";
exit 1
)
# Verify no ERROR, WARNING or NOTE in check results
if test -f rlibkriging.Rcheck/00check.log; then
if grep -E "^Status:.*ERROR" rlibkriging.Rcheck/00check.log; then
echo "ERROR found in R CMD check results"
exit 1
fi
if grep -E "^Status:.*WARNING" rlibkriging.Rcheck/00check.log; then
echo "WARNING found in R CMD check results"
exit 1
fi
#if grep -E "^Status:.*NOTE" rlibkriging.Rcheck/00check.log; then
# echo "NOTE found in R CMD check results"
# exit 1
#fi
fi
- name: Upload CRAN artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: CRAN-${{ matrix.os }}-${{ matrix.r-version }}
path: CRAN-${{ matrix.os }}/