ci: fix build-submit-on-cran.sh to build from current dir and check c… #690
This file contains hidden or 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: 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/actions-setup-cmake@v1.13 | |
| with: | |
| cmake-version: '3.24.x' | |
| - name: R CMD build | |
| shell: bash | |
| env: | |
| OS: ${{ matrix.os }} | |
| run: | | |
| R CMD build . | |
| mkdir CRAN-$OS | |
| mv rlibkriging_*.tar.gz CRAN-$OS/. | |
| echo "PKG_FILE=$(ls CRAN-$OS/rlibkriging_*.tar.gz)" >> $GITHUB_ENV | |
| - name: Install dependencies for tests | |
| shell: bash | |
| run: | | |
| Rscript --no-save ./tools/install_packages.R testthat DiceKriging RobustGaSP | |
| # Verify DiceKriging and RobustGaSP are properly installed | |
| Rscript -e "if (!requireNamespace('DiceKriging', quietly = TRUE)) { stop('DiceKriging installation failed') } else { cat('DiceKriging version:', as.character(packageVersion('DiceKriging')), '\n') }" | |
| Rscript -e "if (!requireNamespace('RobustGaSP', quietly = TRUE)) { stop('RobustGaSP installation failed') } else { cat('RobustGaSP version:', as.character(packageVersion('RobustGaSP')), '\n') }" | |
| - name: R CMD check | |
| shell: bash | |
| run: | | |
| R CMD check --as-cran --no-manual "$PKG_FILE" || ( | |
| 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 }}/ |