From 846b512f62c6d6586b19e4bcfc7c43c931b96bd2 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 5 Aug 2024 13:26:13 -0700 Subject: [PATCH] Create rchk GHA (#6263) * Create rchk GHA * fix yaml config * Add a name, try 'ls' * plain ls output not shown... * missing checkout step * Ensure we're not UNPROTECT()ing 'x' * Couple shots in the dark... * more redundancy...for now... * separate UNPROTECT()? * incidental: fix test numbering * attempt * Revert "attempt" This reverts commit 51caab5d9cf36187837e9414fe45477f902bf221. * a clean a tempt at PROTECT() inside if * Revert "a clean a tempt at PROTECT() inside if" This reverts commit 1784104caa7c6bbe7291b50035714ced8b07815b. * does it not like consecutive UNPROTECT() calls? * PROTECT() more in forder+bmerge * Exclude "results will be incomplete" hits (but always dump output) * -F everything * manual revert faulty merge --------- Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com> --- .github/workflows/rchk.yaml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/rchk.yaml diff --git a/.github/workflows/rchk.yaml b/.github/workflows/rchk.yaml new file mode 100644 index 000000000..c799df028 --- /dev/null +++ b/.github/workflows/rchk.yaml @@ -0,0 +1,59 @@ +# adapted from a similar check run by {arrow} +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +on: + push: + branches: + - master + pull_request: + +name: 'rchk' + +jobs: + rchk: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 'devel' + - name: Build + run: | + ls -l | cat + R CMD build --no-build-vignettes . + mkdir packages + mv data.table_*.tar.gz packages + - name: Run rchk + run: | + docker run -v `pwd`/packages:/rchk/packages kalibera/rchk:latest /rchk/packages/data.table_*.tar.gz |& tee rchk.out + - name: Confirm that rchk has no errors + # Suspicious call, [UP], and [PB] are all of the error types currently at + # https://github.com/kalibera/cran-checks/tree/HEAD/rchk/results + # though this might not be exhaustive, there does not appear to be a way to have rchk return an error code + # CRAN also will remove some of the outputs (especially those related to Rcpp and strptime, e.g. + # ERROR: too many states (abstraction error?)) + # https://github.com/kalibera/rchk + run: | + cat rchk.out + if [ $(grep -Fc "Suspicious call" rchk.out) -gt 0 ] || [ $(grep -F "[UP]" rchk.out | grep -Fvc "results will be incomplete") -gt 0 ] || [ $(grep -Fc "[PB]" rchk.out) -gt 0 ]; then + echo "Found rchk errors" + exit 1 + fi + if: always() + - name: Dump rchk output logs + run: cat rchk.out + if: always()