Skip to content

Next-generation CI/CD pipelines with RunsOn #12095

Next-generation CI/CD pipelines with RunsOn

Next-generation CI/CD pipelines with RunsOn #12095

Workflow file for this run

name: XGBoost-R-Tests
on: [push, pull_request]
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:

Check failure on line 15 in .github/workflows/r_tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/r_tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
BRANCH_NAME: >-
${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }}
USE_DOCKER_CACHE: 1
jobs:
test-rpkg:
name: Test R on ${{ matrix.name }}
runs-on:
- runs-on=${{ github.run_id }}
- runner=linux-amd64-cpu
- tag=r-tests-test-rpkg-${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: rockylinux-cmake
container_id: xgb-ci.gpu_build_r_rockylinux8
build_tool: cmake
- name: rockylinux-autotools
container_id: xgb-ci.gpu_build_r_rockylinux8
build_tool: autotools
- name: alpine-autotools
container_id: xgb-ci.alpine
build_tool: autotools
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
steps:
# Restart Docker daemon so that it recognizes the ephemeral disks
- run: sudo systemctl restart docker
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Fetch container from cache
run: bash ops/docker_build.sh ${{ matrix.container_id }}
- name: Test R
run: |
bash ops/pipeline/test-rpkg.sh ${{ matrix.container_id }} ${{ matrix.build_tool }}
test-rpkg-windows:
runs-on: windows-latest
name: Test R on Windows
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-release-7-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-release-7-${{ hashFiles('R-package/DESCRIPTION') }}
- uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: 'x64'
- uses: r-lib/actions/setup-tinytex@v2
- name: Install dependencies
shell: Rscript {0}
run: |
source("./R-package/tests/helper_scripts/install_deps.R")
- name: Test R
shell: powershell
run: |
python ops/script/test_r_package.py --compiler='mingw' `
--build-tool='autotools' --task=check
test-R-on-Debian:
name: Test R package on Debian
runs-on: ubuntu-latest
container:
image: rhub/debian-gcc-release
steps:
- name: Install system dependencies
run: |
# Must run before checkout to have the latest git installed.
# No need to add pandoc, the container has it figured out.
apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev \
libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y
- name: Trust git cloning project sources
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install dependencies
shell: bash -l {0}
run: |
Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')"
- name: Test R
shell: bash -l {0}
run: |
python3 ops/script/test_r_package.py --r=/usr/bin/R --build-tool=autotools --task=check
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
r_package:
- 'R-package/**'
- name: Run document check
if: steps.changes.outputs.r_package == 'true'
run: |
python3 ops/script/test_r_package.py --r=/usr/bin/R --task=doc