"R-package/tests/vscode:/vscode.git/clone" did not exist on "212d1457eb8a6a45bc93295aab30016728a8d864"
Unverified Commit 7c10e6d8 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] move R-package artifact publishing to GitHub Actions (#7032)



* [ci] move R-package artifact publishing to GitHub Actions

* create artifacts directory

* ensure both files are included

* restore other CI

* create artifacts directory unconditionally

* Update .github/workflows/r_package.yml
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>

---------
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 8666bc63
......@@ -153,6 +153,10 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
cd "${R_CMD_CHECK_DIR}"
fi
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp "${PKG_TARBALL}" "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lightgbm-${LGB_VER}-r-cran.tar.gz"
fi
declare -i allowed_notes=0
bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \
"${PKG_TARBALL}" \
......
......@@ -13,6 +13,9 @@ ARCH=$(uname -m)
LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")
# create the artifact upload directory if it doesn't exist yet
mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "gcc" ]]; then
export CXX=g++-14
export CC=gcc-14
......
......@@ -78,6 +78,7 @@ jobs:
submodules: true
- name: Setup and run tests
run: |
export BUILD_ARTIFACTSTAGINGDIRECTORY="${{ github.workspace }}/artifacts"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export PATH=$CONDA/bin:$PATH
......
......@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true
env:
# tell scripts where to put artifacts
# (this variable name is left over from when jobs ran on Azure DevOps)
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
CMAKE_BUILD_PARALLEL_LEVEL: 4
SKBUILD_STRICT_CONFIG: true
......
......@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true
env:
# tell scripts where to put artifacts
# (this variable name is left over from when jobs ran on Azure DevOps)
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
# in CMake-driven builds, parallelize compilation
CMAKE_BUILD_PARALLEL_LEVEL: 4
# on Debian-based images, avoid interactive prompts
......@@ -114,6 +117,8 @@ jobs:
r_version: 4.3
build_type: cran
container: 'ubuntu:22.04'
produces-artifacts: 'true'
artifact-name: r-cran-package
- os: macos-13
task: r-package
compiler: clang
......@@ -183,6 +188,8 @@ jobs:
export IN_UBUNTU_BASE_CONTAINER="true"
fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")
export PRODUCES_ARTIFACTS="${{ matrix.produces-artifacts }}"
export R_VERSION="${{ matrix.r_version }}"
export R_BUILD_TYPE="${{ matrix.build_type }}"
$GITHUB_WORKSPACE/.ci/setup.sh
......@@ -199,6 +206,13 @@ jobs:
$env:COMPILER = "${{ matrix.compiler }}"
$env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
- name: Upload artifacts
if: ${{ matrix.produces-artifacts == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.tar.gz
if-no-files-found: error
test-r-sanitizers:
name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
timeout-minutes: 60
......
......@@ -331,33 +331,6 @@ jobs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
artifactType: container
##############
# R_artifact #
##############
- job: R_artifact
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: 'ubuntu-22.04'
container: rbase
steps:
- script: |
git clean -d -f -x
displayName: 'Clean source directory'
- script: |
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
R_LIB_PATH=~/Rlib
export R_LIBS=${R_LIB_PATH}
mkdir -p ${R_LIB_PATH}
RDscript .ci/install-r-deps.R --build --include=RhpcBLASctl || exit 1
sh build-cran-package.sh --r-executable=RD || exit 1
mv lightgbm_${LGB_VER}.tar.gz $(Build.ArtifactStagingDirectory)/lightgbm-${LGB_VER}-r-cran.tar.gz
displayName: 'Build CRAN R-package'
- task: PublishBuildArtifacts@1
condition: succeeded()
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: R-package
artifactType: container
###########
# Package #
......@@ -368,7 +341,6 @@ jobs:
- Linux_latest
- macOS
- Windows
- R_artifact
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
pool:
vmImage: 'ubuntu-22.04'
......@@ -399,12 +371,6 @@ jobs:
inputs:
artifactName: PackageAssets
downloadPath: $(Build.SourcesDirectory)/binaries
- task: DownloadBuildArtifacts@0
displayName: Download R-package
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
artifactName: R-package
downloadPath: $(Build.SourcesDirectory)/R
- script: |
python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
displayName: 'Create NuGet configuration files'
......@@ -430,7 +396,6 @@ jobs:
title: '$(Build.SourceBranchName)'
assets: |
$(Build.SourcesDirectory)/binaries/PackageAssets/*
$(Build.SourcesDirectory)/R/R-package/*
$(Build.ArtifactStagingDirectory)/nuget/*.nupkg
$(Build.ArtifactStagingDirectory)/archives/*
assetUploadMode: 'delete'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment