"include/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "b752170ba950890dd7e211fdecedef4d8deffb8b"
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 ...@@ -153,6 +153,10 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
cd "${R_CMD_CHECK_DIR}" cd "${R_CMD_CHECK_DIR}"
fi fi
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp "${PKG_TARBALL}" "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lightgbm-${LGB_VER}-r-cran.tar.gz"
fi
declare -i allowed_notes=0 declare -i allowed_notes=0
bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \ bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \
"${PKG_TARBALL}" \ "${PKG_TARBALL}" \
......
...@@ -13,6 +13,9 @@ ARCH=$(uname -m) ...@@ -13,6 +13,9 @@ ARCH=$(uname -m)
LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt") 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 if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "gcc" ]]; then
export CXX=g++-14 export CXX=g++-14
export CC=gcc-14 export CC=gcc-14
......
...@@ -78,6 +78,7 @@ jobs: ...@@ -78,6 +78,7 @@ jobs:
submodules: true submodules: true
- name: Setup and run tests - name: Setup and run tests
run: | run: |
export BUILD_ARTIFACTSTAGINGDIRECTORY="${{ github.workspace }}/artifacts"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE" export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export PATH=$CONDA/bin:$PATH export PATH=$CONDA/bin:$PATH
......
...@@ -14,6 +14,9 @@ concurrency: ...@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: 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 CMAKE_BUILD_PARALLEL_LEVEL: 4
SKBUILD_STRICT_CONFIG: true SKBUILD_STRICT_CONFIG: true
......
...@@ -14,6 +14,9 @@ concurrency: ...@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: 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 # in CMake-driven builds, parallelize compilation
CMAKE_BUILD_PARALLEL_LEVEL: 4 CMAKE_BUILD_PARALLEL_LEVEL: 4
# on Debian-based images, avoid interactive prompts # on Debian-based images, avoid interactive prompts
...@@ -114,6 +117,8 @@ jobs: ...@@ -114,6 +117,8 @@ jobs:
r_version: 4.3 r_version: 4.3
build_type: cran build_type: cran
container: 'ubuntu:22.04' container: 'ubuntu:22.04'
produces-artifacts: 'true'
artifact-name: r-cran-package
- os: macos-13 - os: macos-13
task: r-package task: r-package
compiler: clang compiler: clang
...@@ -183,6 +188,8 @@ jobs: ...@@ -183,6 +188,8 @@ jobs:
export IN_UBUNTU_BASE_CONTAINER="true" export IN_UBUNTU_BASE_CONTAINER="true"
fi fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE" 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_VERSION="${{ matrix.r_version }}"
export R_BUILD_TYPE="${{ matrix.build_type }}" export R_BUILD_TYPE="${{ matrix.build_type }}"
$GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/setup.sh
...@@ -199,6 +206,13 @@ jobs: ...@@ -199,6 +206,13 @@ jobs:
$env:COMPILER = "${{ matrix.compiler }}" $env:COMPILER = "${{ matrix.compiler }}"
$env:TASK = "${{ matrix.task }}" $env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1" & "$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: test-r-sanitizers:
name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN) name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
timeout-minutes: 60 timeout-minutes: 60
......
...@@ -331,33 +331,6 @@ jobs: ...@@ -331,33 +331,6 @@ jobs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
artifactType: container 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 # # Package #
...@@ -368,7 +341,6 @@ jobs: ...@@ -368,7 +341,6 @@ jobs:
- Linux_latest - Linux_latest
- macOS - macOS
- Windows - Windows
- R_artifact
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
pool: pool:
vmImage: 'ubuntu-22.04' vmImage: 'ubuntu-22.04'
...@@ -399,12 +371,6 @@ jobs: ...@@ -399,12 +371,6 @@ jobs:
inputs: inputs:
artifactName: PackageAssets artifactName: PackageAssets
downloadPath: $(Build.SourcesDirectory)/binaries 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: | - script: |
python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
displayName: 'Create NuGet configuration files' displayName: 'Create NuGet configuration files'
...@@ -430,7 +396,6 @@ jobs: ...@@ -430,7 +396,6 @@ jobs:
title: '$(Build.SourceBranchName)' title: '$(Build.SourceBranchName)'
assets: | assets: |
$(Build.SourcesDirectory)/binaries/PackageAssets/* $(Build.SourcesDirectory)/binaries/PackageAssets/*
$(Build.SourcesDirectory)/R/R-package/*
$(Build.ArtifactStagingDirectory)/nuget/*.nupkg $(Build.ArtifactStagingDirectory)/nuget/*.nupkg
$(Build.ArtifactStagingDirectory)/archives/* $(Build.ArtifactStagingDirectory)/archives/*
assetUploadMode: 'delete' 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