Skip to content

Commit

Permalink
[ci] [R-package] re-enable clang-18 testing (fixes #6369)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Mar 24, 2024
1 parent 4332b9d commit b995bfb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
34 changes: 30 additions & 4 deletions .ci/install-clang-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,30 @@
#
# Installs a development version of clang and the other LLVM tools.
#
# Supported operating systems:
#
# - Debian
# - Ubuntu
#
# [usage]
#
# ./install-clang-devel.sh 18
#

set -e -E -u -o pipefail

CLANG_VERSION=${1}

# get short name, e.g. 'debian', 'ubuntu'
OS_NAME=$(
cat /etc/os-release \
| grep -E '^NAME' \
| cut -d '=' -f2 \
| cut -d ' ' -f1 \
| tr -d '"' \
| tr '[:upper:]' '[:lower:]'
)

apt-get autoremove -y --purge \
clang-* \
libclang-* \
Expand All @@ -25,10 +44,17 @@ apt-get install --no-install-recommends -y \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

# ref: https://apt.llvm.org/
add-apt-repository -y "deb http://apt.llvm.org/unstable/ llvm-toolchain main"
add-apt-repository -y "deb-src http://apt.llvm.org/unstable/ llvm-toolchain main"
add-apt-repository -y "deb http://apt.llvm.org/unstable/ llvm-toolchain-${CLANG_VERSION} main" || true
add-apt-repository -y "deb-src http://apt.llvm.org/unstable/ llvm-toolchain-${CLANG_VERSION} main" || true
if [[ ${OS_NAME} == "debian" ]]; then
add-apt-repository -y "deb [trusted=yes] http://apt.llvm.org/unstable/ llvm-toolchain main"
add-apt-repository -y "deb-src [trusted=yes] http://apt.llvm.org/unstable/ llvm-toolchain main"
add-apt-repository -y "deb [trusted=yes] http://apt.llvm.org/unstable/ llvm-toolchain-${CLANG_VERSION} main" || true
add-apt-repository -y "deb-src [trusted=yes] http://apt.llvm.org/unstable/ llvm-toolchain-${CLANG_VERSION} main" || true
elif [[ ${OS_NAME} == "ubuntu" ]]; then
UBUNTU_CODENAME=$(lsb_release --codename --short)
add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main"
add-apt-repository -y "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main"
fi

apt-get update -y

apt-get install -y --no-install-recommends \
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,25 @@ jobs:
RDscript${{ matrix.r_customization }} testthat.R >> tests.log 2>&1 || exit_code=-1
cat ./tests.log
exit ${exit_code}
test-r-debian-clang:
name: r-package (debian, R-devel, clang-${{ matrix.clang-version }})
test-r-devel-clang:
name: r-package (${{ matrix.os }}, R-devel, clang-${{ matrix.clang-version }})
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# list of versions tested in CRAN "Additional Checks":
# https://cran.r-project.org/web/checks/check_issue_kinds.html
clang-version:
- 16
- 17
include:
- clang-version: 16
container: rhub/debian-clang-devel
os: debian
- clang-version: 17
container: rhub/debian-clang-devel
os: debian
- clang-version: 18
container: ghcr.io/r-hub/containers/ubuntu-clang
os: ubuntu
runs-on: ubuntu-latest
container: rhub/debian-clang-devel
env:
DEBIAN_FRONTEND: noninteractive
steps:
Expand Down Expand Up @@ -315,7 +321,7 @@ jobs:
all-r-package-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs: [test, test-r-debian-clang]
needs: [test, test-r-devel-clang]
steps:
- name: Note that all tests succeeded
uses: re-actors/[email protected]
Expand Down

0 comments on commit b995bfb

Please sign in to comment.