From 809406d8ae26cf846ae3ae16e7d98fe5cd57dc94 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 28 Jan 2021 09:26:11 -0600 Subject: [PATCH 1/4] [ci] fix R linting job (fixes #3873) --- .appveyor.yml | 72 ++-- .ci/test.sh | 2 + .github/workflows/cuda.yml | 178 ++++----- .github/workflows/python_package.yml | 152 ++++---- .github/workflows/r_package.yml | 364 +++++++++--------- .github/workflows/static_analysis.yml | 164 ++++---- .vsts-ci.yml | 518 +++++++++++++------------- 7 files changed, 726 insertions(+), 724 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 96087355b933..f5ad12a60746 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,43 +1,43 @@ -version: 3.1.1.99.{build} +# version: 3.1.1.99.{build} -image: Visual Studio 2015 -platform: x64 -configuration: # a trick to construct a build matrix with multiple Python versions - - 3.7 +# image: Visual Studio 2015 +# platform: x64 +# configuration: # a trick to construct a build matrix with multiple Python versions +# - 3.7 -# only build pull requests and -# commits to 'master' -branches: - only: - - master +# # only build pull requests and +# # commits to 'master' +# branches: +# only: +# - master -environment: - matrix: - - COMPILER: MSVC - TASK: python - - COMPILER: MINGW - TASK: python +# environment: +# matrix: +# - COMPILER: MSVC +# TASK: python +# - COMPILER: MINGW +# TASK: python -clone_depth: 5 +# clone_depth: 5 -install: - - git submodule update --init --recursive # get `external_libs` folder - - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix) - - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% - - set PYTHON_VERSION=%CONFIGURATION% - - set CONDA_ENV="test-env" - - ps: | - switch ($env:PYTHON_VERSION) { - "3.6" {$env:MINICONDA = "C:\Miniconda36-x64"} - "3.7" {$env:MINICONDA = "C:\Miniconda37-x64"} - default {$env:MINICONDA = "C:\Miniconda37-x64"} - } - $env:PATH = "$env:MINICONDA;$env:MINICONDA\Scripts;$env:PATH" - $env:BUILD_SOURCESDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER" - $env:LGB_VER = (Get-Content $env:APPVEYOR_BUILD_FOLDER\VERSION.txt).trim() +# install: +# - git submodule update --init --recursive # get `external_libs` folder +# - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix) +# - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% +# - set PYTHON_VERSION=%CONFIGURATION% +# - set CONDA_ENV="test-env" +# - ps: | +# switch ($env:PYTHON_VERSION) { +# "3.6" {$env:MINICONDA = "C:\Miniconda36-x64"} +# "3.7" {$env:MINICONDA = "C:\Miniconda37-x64"} +# default {$env:MINICONDA = "C:\Miniconda37-x64"} +# } +# $env:PATH = "$env:MINICONDA;$env:MINICONDA\Scripts;$env:PATH" +# $env:BUILD_SOURCESDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER" +# $env:LGB_VER = (Get-Content $env:APPVEYOR_BUILD_FOLDER\VERSION.txt).trim() -build: false +# build: false -test_script: - - conda init powershell - - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 +# test_script: +# - conda init powershell +# - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 diff --git a/.ci/test.sh b/.ci/test.sh index e7d096a31dc5..5937965e7222 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -44,9 +44,11 @@ if [[ $TASK == "lint" ]]; then pycodestyle \ pydocstyle \ r-stringi # stringi needs to be installed separate from r-lintr to avoid issues like 'unable to load shared object stringi.so' + # r-xfun below has to be upgraded because lintr requires > 0.19 for that package conda install -q -y -n $CONDA_ENV \ -c conda-forge \ libxml2 \ + "r-xfun>=0.20" \ "r-lintr>=2.0" pip install --user cpplint mypy echo "Linting Python code" diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 93f09ada0f99..1175972deb32 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -1,92 +1,92 @@ -name: CUDA Version +# name: CUDA Version -on: - push: - branches: - - master - pull_request: - branches: - - master +# on: +# push: +# branches: +# - master +# pull_request: +# branches: +# - master -env: - github_actions: 'true' - os_name: linux - compiler: gcc - task: cuda - conda_env: test-env +# env: +# github_actions: 'true' +# os_name: linux +# compiler: gcc +# task: cuda +# conda_env: test-env -jobs: - test: - name: cuda ${{ matrix.method }} (linux, Python ${{ matrix.python_version }}) - runs-on: [self-hosted, linux] - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - method: source - python_version: 3.6 - - method: pip - python_version: 3.7 - - method: wheel - python_version: 3.8 - steps: - - name: Setup or update software on host machine - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y \ - apt-transport-https \ - ca-certificates \ - curl \ - git \ - gnupg-agent \ - software-properties-common \ - wget - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -y - curl -sL https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - - curl -sL https://nvidia.github.io/nvidia-docker/$(. /etc/os-release;echo $ID$VERSION_ID)/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list - sudo apt-get update - sudo apt-get install --no-install-recommends -y \ - containerd.io \ - docker-ce \ - docker-ce-cli \ - nvidia-docker2 - sudo chmod a+rw /var/run/docker.sock - sudo systemctl restart docker - - name: Remove old folder with repository - run: sudo rm -rf $GITHUB_WORKSPACE - - name: Checkout repository - uses: actions/checkout@v1 - with: - fetch-depth: 5 - submodules: true - - name: Setup and run tests - run: | - export ROOT_DOCKER_FOLDER=/LightGBM - cat > docker.env < docker-script.sh < docker.env < docker-script.sh <&1 > ubsan-tests.log - cat ubsan-tests.log - exit $(cat ubsan-tests.log | grep --count "runtime error") - all-successful: - # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert - runs-on: ubuntu-latest - needs: [test, test-r-sanitizers] - steps: - - name: Note that all tests succeeded - run: echo "🎉" +# jobs: +# test: +# name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }}) +# runs-on: ${{ matrix.os }} +# timeout-minutes: 60 +# strategy: +# fail-fast: false +# matrix: +# include: +# ################ +# # CMake builds # +# ################ +# - os: ubuntu-latest +# task: r-package +# compiler: gcc +# r_version: 3.6 +# build_type: cmake +# - os: ubuntu-latest +# task: r-package +# compiler: gcc +# r_version: 4.0 +# build_type: cmake +# - os: ubuntu-latest +# task: r-package +# compiler: clang +# r_version: 3.6 +# build_type: cmake +# - os: ubuntu-latest +# task: r-package +# compiler: clang +# r_version: 4.0 +# build_type: cmake +# - os: macOS-latest +# task: r-package +# compiler: gcc +# r_version: 3.6 +# build_type: cmake +# - os: macOS-latest +# task: r-package +# compiler: gcc +# r_version: 4.0 +# build_type: cmake +# - os: macOS-latest +# task: r-package +# compiler: clang +# r_version: 3.6 +# build_type: cmake +# - os: macOS-latest +# task: r-package +# compiler: clang +# r_version: 4.0 +# build_type: cmake +# - os: windows-latest +# task: r-package +# compiler: MINGW +# toolchain: MSYS +# r_version: 4.0 +# build_type: cmake +# # Visual Studio 2017 +# - os: windows-2016 +# task: r-package +# compiler: MSVC +# toolchain: MSVC +# r_version: 3.6 +# build_type: cmake +# # Visual Studio 2019 +# - os: windows-2019 +# task: r-package +# compiler: MSVC +# toolchain: MSVC +# r_version: 4.0 +# build_type: cmake +# ############### +# # CRAN builds # +# ############### +# - os: windows-latest +# task: r-package +# compiler: MINGW +# toolchain: MINGW +# r_version: 3.6 +# build_type: cran +# - os: windows-latest +# task: r-package +# compiler: MINGW +# toolchain: MSYS +# r_version: 4.0 +# build_type: cran +# - os: ubuntu-latest +# task: r-package +# compiler: gcc +# r_version: 4.0 +# build_type: cran +# - os: macOS-latest +# task: r-package +# compiler: clang +# r_version: 4.0 +# build_type: cran +# steps: +# - name: Prevent conversion of line endings on Windows +# if: startsWith(matrix.os, 'windows') +# shell: pwsh +# run: git config --global core.autocrlf false +# - name: Checkout repository +# uses: actions/checkout@v2.3.4 +# with: +# fetch-depth: 5 +# submodules: true +# - name: Install pandoc +# uses: r-lib/actions/setup-pandoc@v1 +# - name: Setup and run tests on Linux and macOS +# if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest' +# shell: bash +# run: | +# export TASK="${{ matrix.task }}" +# export COMPILER="${{ matrix.compiler }}" +# export GITHUB_ACTIONS="true" +# if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then +# export OS_NAME="macos" +# elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then +# export OS_NAME="linux" +# fi +# export BUILD_DIRECTORY="$GITHUB_WORKSPACE" +# export R_VERSION="${{ matrix.r_version }}" +# export R_BUILD_TYPE="${{ matrix.build_type }}" +# $GITHUB_WORKSPACE/.ci/setup.sh +# $GITHUB_WORKSPACE/.ci/test.sh +# - name: Setup and run tests on Windows +# if: startsWith(matrix.os, 'windows') +# shell: pwsh -command ". {0}" +# run: | +# $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE +# $env:TOOLCHAIN = "${{ matrix.toolchain }}" +# $env:R_VERSION = "${{ matrix.r_version }}" +# $env:R_BUILD_TYPE = "${{ matrix.build_type }}" +# $env:COMPILER = "${{ matrix.compiler }}" +# $env:GITHUB_ACTIONS = "true" +# $env:TASK = "${{ matrix.task }}" +# & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" +# test-r-sanitizers: +# name: r-package (ubuntu-latest, R-devel, GCC ASAN/UBSAN) +# timeout-minutes: 60 +# runs-on: ubuntu-latest +# container: rhub/rocker-gcc-san +# steps: +# - name: Install Git before checkout +# shell: bash +# run: | +# apt-get update +# apt-get install --no-install-recommends -y git +# - name: Checkout repository +# uses: actions/checkout@v2.3.4 +# with: +# fetch-depth: 5 +# submodules: true +# - name: Install packages +# shell: bash +# run: | +# Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'testthat'), repos = 'https://cran.r-project.org')" +# sh build-cran-package.sh +# Rdevel CMD INSTALL lightgbm_*.tar.gz || exit -1 +# - name: Run tests with sanitizers +# shell: bash +# run: | +# cd R-package/tests +# Rscriptdevel testthat.R 2>&1 > ubsan-tests.log +# cat ubsan-tests.log +# exit $(cat ubsan-tests.log | grep --count "runtime error") +# all-successful: +# # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert +# runs-on: ubuntu-latest +# needs: [test, test-r-sanitizers] +# steps: +# - name: Note that all tests succeeded +# run: echo "🎉" diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index ed9790c8bb06..6fb38cc745f2 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -1,85 +1,85 @@ -# contains non-functional tests, like checks on docs -# and code style -name: Static Analysis +# # contains non-functional tests, like checks on docs +# # and code style +# name: Static Analysis -on: - push: - branches: - - master - pull_request: - branches: - - master +# on: +# push: +# branches: +# - master +# pull_request: +# branches: +# - master -env: - COMPILER: 'gcc' - CONDA_ENV: test-env - GITHUB_ACTIONS: 'true' - OS_NAME: 'linux' - PYTHON_VERSION: 3.8 +# env: +# COMPILER: 'gcc' +# CONDA_ENV: test-env +# GITHUB_ACTIONS: 'true' +# OS_NAME: 'linux' +# PYTHON_VERSION: 3.8 -jobs: - test: - name: ${{ matrix.task }} - runs-on: ubuntu-latest - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - task: lint - - task: check-docs - steps: - - name: Checkout repository - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 5 - submodules: false - - name: Setup and run tests - shell: bash - run: | - export TASK="${{ matrix.task }}" - export BUILD_DIRECTORY="$GITHUB_WORKSPACE" - export CONDA=${HOME}/miniconda - export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} - $GITHUB_WORKSPACE/.ci/setup.sh || exit -1 - $GITHUB_WORKSPACE/.ci/test.sh || exit -1 - r-check-docs: - name: r-package-check-docs - timeout-minutes: 60 - runs-on: ubuntu-latest - container: rocker/verse - steps: - - name: Checkout repository - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 5 - submodules: true - - name: Install packages - shell: bash - run: | - Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org')" - sh build-cran-package.sh || exit -1 - R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit -1 - - name: Test documentation - shell: bash --noprofile --norc {0} - run: | - Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1 - num_doc_files_changed=$( - git diff --name-only | grep --count -E "\.Rd|NAMESPACE" - ) - if [[ ${num_doc_files_changed} -gt 0 ]]; then - echo "Some R documentation files have changed. Please re-generate them and commit those changes." - echo "" - echo " sh build-cran-package.sh" - echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" - echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" - echo "" - exit -1 - fi - all-successful: - # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert - runs-on: ubuntu-latest - needs: [test, r-check-docs] - steps: - - name: Note that all tests succeeded - run: echo "🎉" +# jobs: +# test: +# name: ${{ matrix.task }} +# runs-on: ubuntu-latest +# timeout-minutes: 60 +# strategy: +# fail-fast: false +# matrix: +# include: +# - task: lint +# - task: check-docs +# steps: +# - name: Checkout repository +# uses: actions/checkout@v2.3.4 +# with: +# fetch-depth: 5 +# submodules: false +# - name: Setup and run tests +# shell: bash +# run: | +# export TASK="${{ matrix.task }}" +# export BUILD_DIRECTORY="$GITHUB_WORKSPACE" +# export CONDA=${HOME}/miniconda +# export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} +# $GITHUB_WORKSPACE/.ci/setup.sh || exit -1 +# $GITHUB_WORKSPACE/.ci/test.sh || exit -1 +# r-check-docs: +# name: r-package-check-docs +# timeout-minutes: 60 +# runs-on: ubuntu-latest +# container: rocker/verse +# steps: +# - name: Checkout repository +# uses: actions/checkout@v2.3.4 +# with: +# fetch-depth: 5 +# submodules: true +# - name: Install packages +# shell: bash +# run: | +# Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org')" +# sh build-cran-package.sh || exit -1 +# R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit -1 +# - name: Test documentation +# shell: bash --noprofile --norc {0} +# run: | +# Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1 +# num_doc_files_changed=$( +# git diff --name-only | grep --count -E "\.Rd|NAMESPACE" +# ) +# if [[ ${num_doc_files_changed} -gt 0 ]]; then +# echo "Some R documentation files have changed. Please re-generate them and commit those changes." +# echo "" +# echo " sh build-cran-package.sh" +# echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" +# echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" +# echo "" +# exit -1 +# fi +# all-successful: +# # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert +# runs-on: ubuntu-latest +# needs: [test, r-check-docs] +# steps: +# - name: Note that all tests succeeded +# run: echo "🎉" diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 536a817e66ca..c30ef77b7263 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -1,260 +1,260 @@ -trigger: - branches: - include: - - master - tags: - include: - - v* -pr: -- master -variables: - AZURE: 'true' - PYTHON_VERSION: 3.8 - CONDA_ENV: test-env -resources: - containers: - - container: ubuntu1404 - image: lightgbm/vsts-agent:ubuntu-14.04 - - container: ubuntu-latest - image: 'ubuntu:latest' - options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" -jobs: -########################################### -- job: Linux -########################################### - variables: - COMPILER: gcc - SETUP_CONDA: 'false' - OS_NAME: 'linux' - PRODUCES_ARTIFACTS: 'true' - pool: sh-ubuntu - container: ubuntu1404 - strategy: - matrix: - regular: - TASK: regular - sdist: - TASK: sdist - bdist: - TASK: bdist - PYTHON_VERSION: 3.7 - inference: - TASK: if-else - mpi_source: - TASK: mpi - METHOD: source - gpu_source: - TASK: gpu - METHOD: source - swig: - TASK: swig - steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" - echo "##vso[task.prependpath]$CONDA/bin" - AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK - echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" - LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH - echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" - echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" - displayName: 'Set variables' - - bash: $(Build.SourcesDirectory)/.ci/setup.sh - displayName: Setup - - bash: $(Build.SourcesDirectory)/.ci/test.sh - displayName: Test - - task: PublishBuildArtifacts@1 - condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: PackageAssets - artifactType: container -########################################### -- job: Linux_latest -########################################### - variables: - COMPILER: clang - DEBIAN_FRONTEND: 'noninteractive' - IN_UBUNTU_LATEST_CONTAINER: 'true' - OS_NAME: 'linux' - SETUP_CONDA: 'true' - pool: sh-ubuntu - container: ubuntu-latest - strategy: - matrix: - regular: - TASK: regular - PYTHON_VERSION: 3.6 - sdist: - TASK: sdist - bdist: - TASK: bdist - inference: - TASK: if-else - mpi_source: - TASK: mpi - METHOD: source - mpi_pip: - TASK: mpi - METHOD: pip - PYTHON_VERSION: 3.7 - mpi_wheel: - TASK: mpi - METHOD: wheel - PYTHON_VERSION: 3.7 - gpu_source: - TASK: gpu - METHOD: source - gpu_pip: - TASK: gpu - METHOD: pip - PYTHON_VERSION: 3.6 - gpu_wheel: - TASK: gpu - METHOD: wheel - PYTHON_VERSION: 3.7 - steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" - CONDA=$HOME/miniconda - echo "##vso[task.setvariable variable=CONDA]$CONDA" - echo "##vso[task.prependpath]$CONDA/bin" - AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK - echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" - LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH - echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" - echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" - displayName: 'Set variables' - # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 - - script: | - /tmp/docker exec -t -u 0 ci-container \ - sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" - displayName: 'Install sudo' - - bash: $(Build.SourcesDirectory)/.ci/setup.sh - displayName: Setup - - bash: $(Build.SourcesDirectory)/.ci/test.sh - displayName: Test -########################################### -- job: MacOS -########################################### - variables: - COMPILER: clang - OS_NAME: 'macos' - PRODUCES_ARTIFACTS: 'true' - pool: - vmImage: 'macOS-10.14' - strategy: - matrix: - regular: - TASK: regular - PYTHON_VERSION: 3.7 - sdist: - TASK: sdist - bdist: - TASK: bdist - swig: - TASK: swig - steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" - CONDA=$AGENT_HOMEDIRECTORY/miniconda - echo "##vso[task.setvariable variable=CONDA]$CONDA" - echo "##vso[task.prependpath]$CONDA/bin" - echo "##vso[task.prependpath]$(brew --prefix swig@3)/bin" - echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" - displayName: 'Set variables' - - bash: $(Build.SourcesDirectory)/.ci/setup.sh - displayName: Setup - - bash: $(Build.SourcesDirectory)/.ci/test.sh - displayName: Test - - task: PublishBuildArtifacts@1 - condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: PackageAssets - artifactType: container -########################################### -- job: Windows -########################################### - pool: - vmImage: 'vs2017-win2016' - strategy: - matrix: - regular: - TASK: regular - PYTHON_VERSION: 3.6 - sdist: - TASK: sdist - bdist: - TASK: bdist - swig: - TASK: swig - steps: - - powershell: | - Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: 'Set Variables' - - script: | - cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" - condition: eq(variables['TASK'], 'bdist') - displayName: 'Install OpenCL' - - script: | - cmd /c "conda init powershell" - cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1" - displayName: Test - - task: PublishBuildArtifacts@1 - condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: PackageAssets - artifactType: container +# trigger: +# branches: +# include: +# - master +# tags: +# include: +# - v* +# pr: +# - master +# variables: +# AZURE: 'true' +# PYTHON_VERSION: 3.8 +# CONDA_ENV: test-env +# resources: +# containers: +# - container: ubuntu1404 +# image: lightgbm/vsts-agent:ubuntu-14.04 +# - container: ubuntu-latest +# image: 'ubuntu:latest' +# options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" +# jobs: +# ########################################### +# - job: Linux +# ########################################### +# variables: +# COMPILER: gcc +# SETUP_CONDA: 'false' +# OS_NAME: 'linux' +# PRODUCES_ARTIFACTS: 'true' +# pool: sh-ubuntu +# container: ubuntu1404 +# strategy: +# matrix: +# regular: +# TASK: regular +# sdist: +# TASK: sdist +# bdist: +# TASK: bdist +# PYTHON_VERSION: 3.7 +# inference: +# TASK: if-else +# mpi_source: +# TASK: mpi +# METHOD: source +# gpu_source: +# TASK: gpu +# METHOD: source +# swig: +# TASK: swig +# steps: +# - script: | +# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" +# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" +# echo "##vso[task.prependpath]$CONDA/bin" +# AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK +# echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" +# LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH +# echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" +# echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" +# displayName: 'Set variables' +# - bash: $(Build.SourcesDirectory)/.ci/setup.sh +# displayName: Setup +# - bash: $(Build.SourcesDirectory)/.ci/test.sh +# displayName: Test +# - task: PublishBuildArtifacts@1 +# condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) +# inputs: +# pathtoPublish: '$(Build.ArtifactStagingDirectory)' +# artifactName: PackageAssets +# artifactType: container +# ########################################### +# - job: Linux_latest +# ########################################### +# variables: +# COMPILER: clang +# DEBIAN_FRONTEND: 'noninteractive' +# IN_UBUNTU_LATEST_CONTAINER: 'true' +# OS_NAME: 'linux' +# SETUP_CONDA: 'true' +# pool: sh-ubuntu +# container: ubuntu-latest +# strategy: +# matrix: +# regular: +# TASK: regular +# PYTHON_VERSION: 3.6 +# sdist: +# TASK: sdist +# bdist: +# TASK: bdist +# inference: +# TASK: if-else +# mpi_source: +# TASK: mpi +# METHOD: source +# mpi_pip: +# TASK: mpi +# METHOD: pip +# PYTHON_VERSION: 3.7 +# mpi_wheel: +# TASK: mpi +# METHOD: wheel +# PYTHON_VERSION: 3.7 +# gpu_source: +# TASK: gpu +# METHOD: source +# gpu_pip: +# TASK: gpu +# METHOD: pip +# PYTHON_VERSION: 3.6 +# gpu_wheel: +# TASK: gpu +# METHOD: wheel +# PYTHON_VERSION: 3.7 +# steps: +# - script: | +# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" +# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" +# CONDA=$HOME/miniconda +# echo "##vso[task.setvariable variable=CONDA]$CONDA" +# echo "##vso[task.prependpath]$CONDA/bin" +# AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK +# echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" +# LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH +# echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" +# echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" +# displayName: 'Set variables' +# # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 +# - script: | +# /tmp/docker exec -t -u 0 ci-container \ +# sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" +# displayName: 'Install sudo' +# - bash: $(Build.SourcesDirectory)/.ci/setup.sh +# displayName: Setup +# - bash: $(Build.SourcesDirectory)/.ci/test.sh +# displayName: Test +# ########################################### +# - job: MacOS +# ########################################### +# variables: +# COMPILER: clang +# OS_NAME: 'macos' +# PRODUCES_ARTIFACTS: 'true' +# pool: +# vmImage: 'macOS-10.14' +# strategy: +# matrix: +# regular: +# TASK: regular +# PYTHON_VERSION: 3.7 +# sdist: +# TASK: sdist +# bdist: +# TASK: bdist +# swig: +# TASK: swig +# steps: +# - script: | +# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" +# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" +# CONDA=$AGENT_HOMEDIRECTORY/miniconda +# echo "##vso[task.setvariable variable=CONDA]$CONDA" +# echo "##vso[task.prependpath]$CONDA/bin" +# echo "##vso[task.prependpath]$(brew --prefix swig@3)/bin" +# echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" +# displayName: 'Set variables' +# - bash: $(Build.SourcesDirectory)/.ci/setup.sh +# displayName: Setup +# - bash: $(Build.SourcesDirectory)/.ci/test.sh +# displayName: Test +# - task: PublishBuildArtifacts@1 +# condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) +# inputs: +# pathtoPublish: '$(Build.ArtifactStagingDirectory)' +# artifactName: PackageAssets +# artifactType: container +# ########################################### +# - job: Windows +# ########################################### +# pool: +# vmImage: 'vs2017-win2016' +# strategy: +# matrix: +# regular: +# TASK: regular +# PYTHON_VERSION: 3.6 +# sdist: +# TASK: sdist +# bdist: +# TASK: bdist +# swig: +# TASK: swig +# steps: +# - powershell: | +# Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" +# displayName: 'Set Variables' +# - script: | +# cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" +# condition: eq(variables['TASK'], 'bdist') +# displayName: 'Install OpenCL' +# - script: | +# cmd /c "conda init powershell" +# cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1" +# displayName: Test +# - task: PublishBuildArtifacts@1 +# condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) +# inputs: +# pathtoPublish: '$(Build.ArtifactStagingDirectory)' +# artifactName: PackageAssets +# artifactType: container -########################################### -- job: Package -########################################### - dependsOn: - - Linux - - Linux_latest - - MacOS - - Windows - condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) - pool: - vmImage: 'ubuntu-latest' - steps: - # Download all agent packages from all previous phases - - task: DownloadBuildArtifacts@0 - displayName: Download package assets - inputs: - artifactName: PackageAssets - downloadPath: $(Build.SourcesDirectory)/binaries - - script: | - python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" - displayName: 'Create NuGet configuration files' - - task: NuGetCommand@2 - inputs: - command: pack - packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' - packDestination: '$(Build.ArtifactStagingDirectory)' - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: NuGet - artifactType: container - - task: GitHubRelease@0 - displayName: 'Create GitHub Release' - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) - inputs: - gitHubConnection: guolinke - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'auto' - title: '$(Build.SourceBranchName)' - assets: | - $(Build.SourcesDirectory)/binaries/PackageAssets/* - $(Build.ArtifactStagingDirectory)/*.nupkg - assetUploadMode: 'delete' - isDraft: true - isPreRelease: false - addChangeLog: false +# ########################################### +# - job: Package +# ########################################### +# dependsOn: +# - Linux +# - Linux_latest +# - MacOS +# - Windows +# condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) +# pool: +# vmImage: 'ubuntu-latest' +# steps: +# # Download all agent packages from all previous phases +# - task: DownloadBuildArtifacts@0 +# displayName: Download package assets +# inputs: +# artifactName: PackageAssets +# downloadPath: $(Build.SourcesDirectory)/binaries +# - script: | +# python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" +# displayName: 'Create NuGet configuration files' +# - task: NuGetCommand@2 +# inputs: +# command: pack +# packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' +# packDestination: '$(Build.ArtifactStagingDirectory)' +# - task: PublishBuildArtifacts@1 +# inputs: +# pathtoPublish: '$(Build.ArtifactStagingDirectory)' +# artifactName: NuGet +# artifactType: container +# - task: GitHubRelease@0 +# displayName: 'Create GitHub Release' +# condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) +# inputs: +# gitHubConnection: guolinke +# repositoryName: '$(Build.Repository.Name)' +# action: 'create' +# target: '$(Build.SourceVersion)' +# tagSource: 'auto' +# title: '$(Build.SourceBranchName)' +# assets: | +# $(Build.SourcesDirectory)/binaries/PackageAssets/* +# $(Build.ArtifactStagingDirectory)/*.nupkg +# assetUploadMode: 'delete' +# isDraft: true +# isPreRelease: false +# addChangeLog: false From 29d9b628d48d9017612263b1f8483f263d76e976 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 28 Jan 2021 09:29:34 -0600 Subject: [PATCH 2/4] need to run static analysis --- .github/workflows/static_analysis.yml | 164 +++++++++++++------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 6fb38cc745f2..ed9790c8bb06 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -1,85 +1,85 @@ -# # contains non-functional tests, like checks on docs -# # and code style -# name: Static Analysis +# contains non-functional tests, like checks on docs +# and code style +name: Static Analysis -# on: -# push: -# branches: -# - master -# pull_request: -# branches: -# - master +on: + push: + branches: + - master + pull_request: + branches: + - master -# env: -# COMPILER: 'gcc' -# CONDA_ENV: test-env -# GITHUB_ACTIONS: 'true' -# OS_NAME: 'linux' -# PYTHON_VERSION: 3.8 +env: + COMPILER: 'gcc' + CONDA_ENV: test-env + GITHUB_ACTIONS: 'true' + OS_NAME: 'linux' + PYTHON_VERSION: 3.8 -# jobs: -# test: -# name: ${{ matrix.task }} -# runs-on: ubuntu-latest -# timeout-minutes: 60 -# strategy: -# fail-fast: false -# matrix: -# include: -# - task: lint -# - task: check-docs -# steps: -# - name: Checkout repository -# uses: actions/checkout@v2.3.4 -# with: -# fetch-depth: 5 -# submodules: false -# - name: Setup and run tests -# shell: bash -# run: | -# export TASK="${{ matrix.task }}" -# export BUILD_DIRECTORY="$GITHUB_WORKSPACE" -# export CONDA=${HOME}/miniconda -# export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} -# $GITHUB_WORKSPACE/.ci/setup.sh || exit -1 -# $GITHUB_WORKSPACE/.ci/test.sh || exit -1 -# r-check-docs: -# name: r-package-check-docs -# timeout-minutes: 60 -# runs-on: ubuntu-latest -# container: rocker/verse -# steps: -# - name: Checkout repository -# uses: actions/checkout@v2.3.4 -# with: -# fetch-depth: 5 -# submodules: true -# - name: Install packages -# shell: bash -# run: | -# Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org')" -# sh build-cran-package.sh || exit -1 -# R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit -1 -# - name: Test documentation -# shell: bash --noprofile --norc {0} -# run: | -# Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1 -# num_doc_files_changed=$( -# git diff --name-only | grep --count -E "\.Rd|NAMESPACE" -# ) -# if [[ ${num_doc_files_changed} -gt 0 ]]; then -# echo "Some R documentation files have changed. Please re-generate them and commit those changes." -# echo "" -# echo " sh build-cran-package.sh" -# echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" -# echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" -# echo "" -# exit -1 -# fi -# all-successful: -# # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert -# runs-on: ubuntu-latest -# needs: [test, r-check-docs] -# steps: -# - name: Note that all tests succeeded -# run: echo "🎉" +jobs: + test: + name: ${{ matrix.task }} + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - task: lint + - task: check-docs + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: false + - name: Setup and run tests + shell: bash + run: | + export TASK="${{ matrix.task }}" + export BUILD_DIRECTORY="$GITHUB_WORKSPACE" + export CONDA=${HOME}/miniconda + export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} + $GITHUB_WORKSPACE/.ci/setup.sh || exit -1 + $GITHUB_WORKSPACE/.ci/test.sh || exit -1 + r-check-docs: + name: r-package-check-docs + timeout-minutes: 60 + runs-on: ubuntu-latest + container: rocker/verse + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: true + - name: Install packages + shell: bash + run: | + Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org')" + sh build-cran-package.sh || exit -1 + R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit -1 + - name: Test documentation + shell: bash --noprofile --norc {0} + run: | + Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1 + num_doc_files_changed=$( + git diff --name-only | grep --count -E "\.Rd|NAMESPACE" + ) + if [[ ${num_doc_files_changed} -gt 0 ]]; then + echo "Some R documentation files have changed. Please re-generate them and commit those changes." + echo "" + echo " sh build-cran-package.sh" + echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" + echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" + echo "" + exit -1 + fi + all-successful: + # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert + runs-on: ubuntu-latest + needs: [test, r-check-docs] + steps: + - name: Note that all tests succeeded + run: echo "🎉" From d0a941a17eb9e736ec76c86ce655450aea7189ba Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 28 Jan 2021 09:39:21 -0600 Subject: [PATCH 3/4] uncomment CI configs --- .appveyor.yml | 72 ++-- .github/workflows/cuda.yml | 178 ++++----- .github/workflows/python_package.yml | 152 ++++---- .github/workflows/r_package.yml | 364 +++++++++---------- .vsts-ci.yml | 518 +++++++++++++-------------- 5 files changed, 642 insertions(+), 642 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f5ad12a60746..96087355b933 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,43 +1,43 @@ -# version: 3.1.1.99.{build} +version: 3.1.1.99.{build} -# image: Visual Studio 2015 -# platform: x64 -# configuration: # a trick to construct a build matrix with multiple Python versions -# - 3.7 +image: Visual Studio 2015 +platform: x64 +configuration: # a trick to construct a build matrix with multiple Python versions + - 3.7 -# # only build pull requests and -# # commits to 'master' -# branches: -# only: -# - master +# only build pull requests and +# commits to 'master' +branches: + only: + - master -# environment: -# matrix: -# - COMPILER: MSVC -# TASK: python -# - COMPILER: MINGW -# TASK: python +environment: + matrix: + - COMPILER: MSVC + TASK: python + - COMPILER: MINGW + TASK: python -# clone_depth: 5 +clone_depth: 5 -# install: -# - git submodule update --init --recursive # get `external_libs` folder -# - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix) -# - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% -# - set PYTHON_VERSION=%CONFIGURATION% -# - set CONDA_ENV="test-env" -# - ps: | -# switch ($env:PYTHON_VERSION) { -# "3.6" {$env:MINICONDA = "C:\Miniconda36-x64"} -# "3.7" {$env:MINICONDA = "C:\Miniconda37-x64"} -# default {$env:MINICONDA = "C:\Miniconda37-x64"} -# } -# $env:PATH = "$env:MINICONDA;$env:MINICONDA\Scripts;$env:PATH" -# $env:BUILD_SOURCESDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER" -# $env:LGB_VER = (Get-Content $env:APPVEYOR_BUILD_FOLDER\VERSION.txt).trim() +install: + - git submodule update --init --recursive # get `external_libs` folder + - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix) + - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% + - set PYTHON_VERSION=%CONFIGURATION% + - set CONDA_ENV="test-env" + - ps: | + switch ($env:PYTHON_VERSION) { + "3.6" {$env:MINICONDA = "C:\Miniconda36-x64"} + "3.7" {$env:MINICONDA = "C:\Miniconda37-x64"} + default {$env:MINICONDA = "C:\Miniconda37-x64"} + } + $env:PATH = "$env:MINICONDA;$env:MINICONDA\Scripts;$env:PATH" + $env:BUILD_SOURCESDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER" + $env:LGB_VER = (Get-Content $env:APPVEYOR_BUILD_FOLDER\VERSION.txt).trim() -# build: false +build: false -# test_script: -# - conda init powershell -# - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 +test_script: + - conda init powershell + - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 1175972deb32..93f09ada0f99 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -1,92 +1,92 @@ -# name: CUDA Version +name: CUDA Version -# on: -# push: -# branches: -# - master -# pull_request: -# branches: -# - master +on: + push: + branches: + - master + pull_request: + branches: + - master -# env: -# github_actions: 'true' -# os_name: linux -# compiler: gcc -# task: cuda -# conda_env: test-env +env: + github_actions: 'true' + os_name: linux + compiler: gcc + task: cuda + conda_env: test-env -# jobs: -# test: -# name: cuda ${{ matrix.method }} (linux, Python ${{ matrix.python_version }}) -# runs-on: [self-hosted, linux] -# timeout-minutes: 60 -# strategy: -# fail-fast: false -# matrix: -# include: -# - method: source -# python_version: 3.6 -# - method: pip -# python_version: 3.7 -# - method: wheel -# python_version: 3.8 -# steps: -# - name: Setup or update software on host machine -# run: | -# sudo apt-get update -# sudo apt-get install --no-install-recommends -y \ -# apt-transport-https \ -# ca-certificates \ -# curl \ -# git \ -# gnupg-agent \ -# software-properties-common \ -# wget -# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -y -# curl -sL https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - -# curl -sL https://nvidia.github.io/nvidia-docker/$(. /etc/os-release;echo $ID$VERSION_ID)/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list -# sudo apt-get update -# sudo apt-get install --no-install-recommends -y \ -# containerd.io \ -# docker-ce \ -# docker-ce-cli \ -# nvidia-docker2 -# sudo chmod a+rw /var/run/docker.sock -# sudo systemctl restart docker -# - name: Remove old folder with repository -# run: sudo rm -rf $GITHUB_WORKSPACE -# - name: Checkout repository -# uses: actions/checkout@v1 -# with: -# fetch-depth: 5 -# submodules: true -# - name: Setup and run tests -# run: | -# export ROOT_DOCKER_FOLDER=/LightGBM -# cat > docker.env < docker-script.sh < docker.env < docker-script.sh <&1 > ubsan-tests.log -# cat ubsan-tests.log -# exit $(cat ubsan-tests.log | grep --count "runtime error") -# all-successful: -# # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert -# runs-on: ubuntu-latest -# needs: [test, test-r-sanitizers] -# steps: -# - name: Note that all tests succeeded -# run: echo "🎉" +jobs: + test: + name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + ################ + # CMake builds # + ################ + - os: ubuntu-latest + task: r-package + compiler: gcc + r_version: 3.6 + build_type: cmake + - os: ubuntu-latest + task: r-package + compiler: gcc + r_version: 4.0 + build_type: cmake + - os: ubuntu-latest + task: r-package + compiler: clang + r_version: 3.6 + build_type: cmake + - os: ubuntu-latest + task: r-package + compiler: clang + r_version: 4.0 + build_type: cmake + - os: macOS-latest + task: r-package + compiler: gcc + r_version: 3.6 + build_type: cmake + - os: macOS-latest + task: r-package + compiler: gcc + r_version: 4.0 + build_type: cmake + - os: macOS-latest + task: r-package + compiler: clang + r_version: 3.6 + build_type: cmake + - os: macOS-latest + task: r-package + compiler: clang + r_version: 4.0 + build_type: cmake + - os: windows-latest + task: r-package + compiler: MINGW + toolchain: MSYS + r_version: 4.0 + build_type: cmake + # Visual Studio 2017 + - os: windows-2016 + task: r-package + compiler: MSVC + toolchain: MSVC + r_version: 3.6 + build_type: cmake + # Visual Studio 2019 + - os: windows-2019 + task: r-package + compiler: MSVC + toolchain: MSVC + r_version: 4.0 + build_type: cmake + ############### + # CRAN builds # + ############### + - os: windows-latest + task: r-package + compiler: MINGW + toolchain: MINGW + r_version: 3.6 + build_type: cran + - os: windows-latest + task: r-package + compiler: MINGW + toolchain: MSYS + r_version: 4.0 + build_type: cran + - os: ubuntu-latest + task: r-package + compiler: gcc + r_version: 4.0 + build_type: cran + - os: macOS-latest + task: r-package + compiler: clang + r_version: 4.0 + build_type: cran + steps: + - name: Prevent conversion of line endings on Windows + if: startsWith(matrix.os, 'windows') + shell: pwsh + run: git config --global core.autocrlf false + - name: Checkout repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: true + - name: Install pandoc + uses: r-lib/actions/setup-pandoc@v1 + - name: Setup and run tests on Linux and macOS + if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest' + shell: bash + run: | + export TASK="${{ matrix.task }}" + export COMPILER="${{ matrix.compiler }}" + export GITHUB_ACTIONS="true" + if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then + export OS_NAME="macos" + elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + export OS_NAME="linux" + fi + export BUILD_DIRECTORY="$GITHUB_WORKSPACE" + export R_VERSION="${{ matrix.r_version }}" + export R_BUILD_TYPE="${{ matrix.build_type }}" + $GITHUB_WORKSPACE/.ci/setup.sh + $GITHUB_WORKSPACE/.ci/test.sh + - name: Setup and run tests on Windows + if: startsWith(matrix.os, 'windows') + shell: pwsh -command ". {0}" + run: | + $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + $env:TOOLCHAIN = "${{ matrix.toolchain }}" + $env:R_VERSION = "${{ matrix.r_version }}" + $env:R_BUILD_TYPE = "${{ matrix.build_type }}" + $env:COMPILER = "${{ matrix.compiler }}" + $env:GITHUB_ACTIONS = "true" + $env:TASK = "${{ matrix.task }}" + & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" + test-r-sanitizers: + name: r-package (ubuntu-latest, R-devel, GCC ASAN/UBSAN) + timeout-minutes: 60 + runs-on: ubuntu-latest + container: rhub/rocker-gcc-san + steps: + - name: Install Git before checkout + shell: bash + run: | + apt-get update + apt-get install --no-install-recommends -y git + - name: Checkout repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: true + - name: Install packages + shell: bash + run: | + Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'testthat'), repos = 'https://cran.r-project.org')" + sh build-cran-package.sh + Rdevel CMD INSTALL lightgbm_*.tar.gz || exit -1 + - name: Run tests with sanitizers + shell: bash + run: | + cd R-package/tests + Rscriptdevel testthat.R 2>&1 > ubsan-tests.log + cat ubsan-tests.log + exit $(cat ubsan-tests.log | grep --count "runtime error") + all-successful: + # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert + runs-on: ubuntu-latest + needs: [test, test-r-sanitizers] + steps: + - name: Note that all tests succeeded + run: echo "🎉" diff --git a/.vsts-ci.yml b/.vsts-ci.yml index c30ef77b7263..536a817e66ca 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -1,260 +1,260 @@ -# trigger: -# branches: -# include: -# - master -# tags: -# include: -# - v* -# pr: -# - master -# variables: -# AZURE: 'true' -# PYTHON_VERSION: 3.8 -# CONDA_ENV: test-env -# resources: -# containers: -# - container: ubuntu1404 -# image: lightgbm/vsts-agent:ubuntu-14.04 -# - container: ubuntu-latest -# image: 'ubuntu:latest' -# options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" -# jobs: -# ########################################### -# - job: Linux -# ########################################### -# variables: -# COMPILER: gcc -# SETUP_CONDA: 'false' -# OS_NAME: 'linux' -# PRODUCES_ARTIFACTS: 'true' -# pool: sh-ubuntu -# container: ubuntu1404 -# strategy: -# matrix: -# regular: -# TASK: regular -# sdist: -# TASK: sdist -# bdist: -# TASK: bdist -# PYTHON_VERSION: 3.7 -# inference: -# TASK: if-else -# mpi_source: -# TASK: mpi -# METHOD: source -# gpu_source: -# TASK: gpu -# METHOD: source -# swig: -# TASK: swig -# steps: -# - script: | -# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" -# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" -# echo "##vso[task.prependpath]$CONDA/bin" -# AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK -# echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" -# LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH -# echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" -# echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" -# displayName: 'Set variables' -# - bash: $(Build.SourcesDirectory)/.ci/setup.sh -# displayName: Setup -# - bash: $(Build.SourcesDirectory)/.ci/test.sh -# displayName: Test -# - task: PublishBuildArtifacts@1 -# condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)' -# artifactName: PackageAssets -# artifactType: container -# ########################################### -# - job: Linux_latest -# ########################################### -# variables: -# COMPILER: clang -# DEBIAN_FRONTEND: 'noninteractive' -# IN_UBUNTU_LATEST_CONTAINER: 'true' -# OS_NAME: 'linux' -# SETUP_CONDA: 'true' -# pool: sh-ubuntu -# container: ubuntu-latest -# strategy: -# matrix: -# regular: -# TASK: regular -# PYTHON_VERSION: 3.6 -# sdist: -# TASK: sdist -# bdist: -# TASK: bdist -# inference: -# TASK: if-else -# mpi_source: -# TASK: mpi -# METHOD: source -# mpi_pip: -# TASK: mpi -# METHOD: pip -# PYTHON_VERSION: 3.7 -# mpi_wheel: -# TASK: mpi -# METHOD: wheel -# PYTHON_VERSION: 3.7 -# gpu_source: -# TASK: gpu -# METHOD: source -# gpu_pip: -# TASK: gpu -# METHOD: pip -# PYTHON_VERSION: 3.6 -# gpu_wheel: -# TASK: gpu -# METHOD: wheel -# PYTHON_VERSION: 3.7 -# steps: -# - script: | -# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" -# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" -# CONDA=$HOME/miniconda -# echo "##vso[task.setvariable variable=CONDA]$CONDA" -# echo "##vso[task.prependpath]$CONDA/bin" -# AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK -# echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" -# LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH -# echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" -# echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" -# displayName: 'Set variables' -# # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 -# - script: | -# /tmp/docker exec -t -u 0 ci-container \ -# sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" -# displayName: 'Install sudo' -# - bash: $(Build.SourcesDirectory)/.ci/setup.sh -# displayName: Setup -# - bash: $(Build.SourcesDirectory)/.ci/test.sh -# displayName: Test -# ########################################### -# - job: MacOS -# ########################################### -# variables: -# COMPILER: clang -# OS_NAME: 'macos' -# PRODUCES_ARTIFACTS: 'true' -# pool: -# vmImage: 'macOS-10.14' -# strategy: -# matrix: -# regular: -# TASK: regular -# PYTHON_VERSION: 3.7 -# sdist: -# TASK: sdist -# bdist: -# TASK: bdist -# swig: -# TASK: swig -# steps: -# - script: | -# echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" -# echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" -# CONDA=$AGENT_HOMEDIRECTORY/miniconda -# echo "##vso[task.setvariable variable=CONDA]$CONDA" -# echo "##vso[task.prependpath]$CONDA/bin" -# echo "##vso[task.prependpath]$(brew --prefix swig@3)/bin" -# echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" -# displayName: 'Set variables' -# - bash: $(Build.SourcesDirectory)/.ci/setup.sh -# displayName: Setup -# - bash: $(Build.SourcesDirectory)/.ci/test.sh -# displayName: Test -# - task: PublishBuildArtifacts@1 -# condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)' -# artifactName: PackageAssets -# artifactType: container -# ########################################### -# - job: Windows -# ########################################### -# pool: -# vmImage: 'vs2017-win2016' -# strategy: -# matrix: -# regular: -# TASK: regular -# PYTHON_VERSION: 3.6 -# sdist: -# TASK: sdist -# bdist: -# TASK: bdist -# swig: -# TASK: swig -# steps: -# - powershell: | -# Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" -# displayName: 'Set Variables' -# - script: | -# cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" -# condition: eq(variables['TASK'], 'bdist') -# displayName: 'Install OpenCL' -# - script: | -# cmd /c "conda init powershell" -# cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1" -# displayName: Test -# - task: PublishBuildArtifacts@1 -# condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)' -# artifactName: PackageAssets -# artifactType: container +trigger: + branches: + include: + - master + tags: + include: + - v* +pr: +- master +variables: + AZURE: 'true' + PYTHON_VERSION: 3.8 + CONDA_ENV: test-env +resources: + containers: + - container: ubuntu1404 + image: lightgbm/vsts-agent:ubuntu-14.04 + - container: ubuntu-latest + image: 'ubuntu:latest' + options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" +jobs: +########################################### +- job: Linux +########################################### + variables: + COMPILER: gcc + SETUP_CONDA: 'false' + OS_NAME: 'linux' + PRODUCES_ARTIFACTS: 'true' + pool: sh-ubuntu + container: ubuntu1404 + strategy: + matrix: + regular: + TASK: regular + sdist: + TASK: sdist + bdist: + TASK: bdist + PYTHON_VERSION: 3.7 + inference: + TASK: if-else + mpi_source: + TASK: mpi + METHOD: source + gpu_source: + TASK: gpu + METHOD: source + swig: + TASK: swig + steps: + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" + echo "##vso[task.prependpath]$CONDA/bin" + AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK + echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" + LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH + echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" + echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" + displayName: 'Set variables' + - bash: $(Build.SourcesDirectory)/.ci/setup.sh + displayName: Setup + - bash: $(Build.SourcesDirectory)/.ci/test.sh + displayName: Test + - task: PublishBuildArtifacts@1 + condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: PackageAssets + artifactType: container +########################################### +- job: Linux_latest +########################################### + variables: + COMPILER: clang + DEBIAN_FRONTEND: 'noninteractive' + IN_UBUNTU_LATEST_CONTAINER: 'true' + OS_NAME: 'linux' + SETUP_CONDA: 'true' + pool: sh-ubuntu + container: ubuntu-latest + strategy: + matrix: + regular: + TASK: regular + PYTHON_VERSION: 3.6 + sdist: + TASK: sdist + bdist: + TASK: bdist + inference: + TASK: if-else + mpi_source: + TASK: mpi + METHOD: source + mpi_pip: + TASK: mpi + METHOD: pip + PYTHON_VERSION: 3.7 + mpi_wheel: + TASK: mpi + METHOD: wheel + PYTHON_VERSION: 3.7 + gpu_source: + TASK: gpu + METHOD: source + gpu_pip: + TASK: gpu + METHOD: pip + PYTHON_VERSION: 3.6 + gpu_wheel: + TASK: gpu + METHOD: wheel + PYTHON_VERSION: 3.7 + steps: + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" + CONDA=$HOME/miniconda + echo "##vso[task.setvariable variable=CONDA]$CONDA" + echo "##vso[task.prependpath]$CONDA/bin" + AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK + echo "##vso[task.setvariable variable=AMDAPPSDK_PATH]$AMDAPPSDK_PATH" + LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH + echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" + echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" + displayName: 'Set variables' + # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 + - script: | + /tmp/docker exec -t -u 0 ci-container \ + sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" + displayName: 'Install sudo' + - bash: $(Build.SourcesDirectory)/.ci/setup.sh + displayName: Setup + - bash: $(Build.SourcesDirectory)/.ci/test.sh + displayName: Test +########################################### +- job: MacOS +########################################### + variables: + COMPILER: clang + OS_NAME: 'macos' + PRODUCES_ARTIFACTS: 'true' + pool: + vmImage: 'macOS-10.14' + strategy: + matrix: + regular: + TASK: regular + PYTHON_VERSION: 3.7 + sdist: + TASK: sdist + bdist: + TASK: bdist + swig: + TASK: swig + steps: + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" + CONDA=$AGENT_HOMEDIRECTORY/miniconda + echo "##vso[task.setvariable variable=CONDA]$CONDA" + echo "##vso[task.prependpath]$CONDA/bin" + echo "##vso[task.prependpath]$(brew --prefix swig@3)/bin" + echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" + displayName: 'Set variables' + - bash: $(Build.SourcesDirectory)/.ci/setup.sh + displayName: Setup + - bash: $(Build.SourcesDirectory)/.ci/test.sh + displayName: Test + - task: PublishBuildArtifacts@1 + condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: PackageAssets + artifactType: container +########################################### +- job: Windows +########################################### + pool: + vmImage: 'vs2017-win2016' + strategy: + matrix: + regular: + TASK: regular + PYTHON_VERSION: 3.6 + sdist: + TASK: sdist + bdist: + TASK: bdist + swig: + TASK: swig + steps: + - powershell: | + Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" + displayName: 'Set Variables' + - script: | + cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1" + condition: eq(variables['TASK'], 'bdist') + displayName: 'Install OpenCL' + - script: | + cmd /c "conda init powershell" + cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1" + displayName: Test + - task: PublishBuildArtifacts@1 + condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: PackageAssets + artifactType: container -# ########################################### -# - job: Package -# ########################################### -# dependsOn: -# - Linux -# - Linux_latest -# - MacOS -# - Windows -# condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) -# pool: -# vmImage: 'ubuntu-latest' -# steps: -# # Download all agent packages from all previous phases -# - task: DownloadBuildArtifacts@0 -# displayName: Download package assets -# inputs: -# artifactName: PackageAssets -# downloadPath: $(Build.SourcesDirectory)/binaries -# - script: | -# python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" -# displayName: 'Create NuGet configuration files' -# - task: NuGetCommand@2 -# inputs: -# command: pack -# packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' -# packDestination: '$(Build.ArtifactStagingDirectory)' -# - task: PublishBuildArtifacts@1 -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)' -# artifactName: NuGet -# artifactType: container -# - task: GitHubRelease@0 -# displayName: 'Create GitHub Release' -# condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) -# inputs: -# gitHubConnection: guolinke -# repositoryName: '$(Build.Repository.Name)' -# action: 'create' -# target: '$(Build.SourceVersion)' -# tagSource: 'auto' -# title: '$(Build.SourceBranchName)' -# assets: | -# $(Build.SourcesDirectory)/binaries/PackageAssets/* -# $(Build.ArtifactStagingDirectory)/*.nupkg -# assetUploadMode: 'delete' -# isDraft: true -# isPreRelease: false -# addChangeLog: false +########################################### +- job: Package +########################################### + dependsOn: + - Linux + - Linux_latest + - MacOS + - Windows + condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) + pool: + vmImage: 'ubuntu-latest' + steps: + # Download all agent packages from all previous phases + - task: DownloadBuildArtifacts@0 + displayName: Download package assets + inputs: + artifactName: PackageAssets + downloadPath: $(Build.SourcesDirectory)/binaries + - script: | + python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" + displayName: 'Create NuGet configuration files' + - task: NuGetCommand@2 + inputs: + command: pack + packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' + packDestination: '$(Build.ArtifactStagingDirectory)' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: NuGet + artifactType: container + - task: GitHubRelease@0 + displayName: 'Create GitHub Release' + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + inputs: + gitHubConnection: guolinke + repositoryName: '$(Build.Repository.Name)' + action: 'create' + target: '$(Build.SourceVersion)' + tagSource: 'auto' + title: '$(Build.SourceBranchName)' + assets: | + $(Build.SourcesDirectory)/binaries/PackageAssets/* + $(Build.ArtifactStagingDirectory)/*.nupkg + assetUploadMode: 'delete' + isDraft: true + isPreRelease: false + addChangeLog: false From 5729b9afc3bc9f01d1b633bba4ba7ec6b250c1ed Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 28 Jan 2021 09:42:02 -0600 Subject: [PATCH 4/4] Update .ci/test.sh --- .ci/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index 5937965e7222..a150d33ffab0 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -48,7 +48,7 @@ if [[ $TASK == "lint" ]]; then conda install -q -y -n $CONDA_ENV \ -c conda-forge \ libxml2 \ - "r-xfun>=0.20" \ + "r-xfun>=0.19" \ "r-lintr>=2.0" pip install --user cpplint mypy echo "Linting Python code"