From 7e9d16abfe093f144d2fb6ab1ea89e4d04b164c3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 20:51:52 -0500 Subject: [PATCH 01/95] GitHub Actions --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000000..10f558c02465 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, ubuntu-18.04] + task: [r-package] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2 + - name: env_vars + run: | + test -n $CC && unset CC + test -n $CXX && unset CXX + export HOME_DIRECTORY="$HOME" + export BUILD_DIRECTORY="$TRAVIS_BUILD_DIR" + if [[ $TRAVIS_OS_NAME == "osx" ]]; then + export OS_NAME="macos"; + export COMPILER="gcc"; + export R_MAC_VERSION=3.6.3; + else + export OS_NAME="linux"; + export COMPILER="clang"; + export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; + fi + export CONDA="$HOME/miniconda" + export PATH="$CONDA/bin:$PATH" + export CONDA_ENV="test-env" + export LGB_VER=$(head -n 1 VERSION.txt) + export AMDAPPSDK_PATH=$HOME/AMDAPPSDK + export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="/usr/local/clang/lib:$LD_LIBRARY_PATH" # fix error "libomp.so: cannot open shared object file: No such file or directory" on Linux with Clang + export OPENCL_VENDOR_PATH=$AMDAPPSDK_PATH/etc/OpenCL/vendors + - name: setup + env: + TASK: {{ matrix.task }} + run: bash .ci/setup.sh + - name: test + env: + TASK: {{ matrix.task }} + run: bash .ci/test.sh From 4c9d0ccc1f87c7f03d182b431e32702248406ca6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 20:56:22 -0500 Subject: [PATCH 02/95] ok --- .github/workflows/main.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10f558c02465..8ca5f1caa041 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,22 +5,20 @@ name: CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -strategy: - fail-fast: false - matrix: - os: [ubuntu-16.04, ubuntu-18.04] - task: [r-package] + - push: + branches: [ master ] + - pull_request: + branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: - # The type of runner that the job will run on + strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, ubuntu-18.04] + task: [r-package] runs-on: ${{ matrix.os }} # Steps represent a sequence of tasks that will be executed as part of the job From 740d1d95227b51aaa9062a9f95ee747eb122bbca Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 20:57:49 -0500 Subject: [PATCH 03/95] fixing on list --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ca5f1caa041..10ffcc3efde3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,10 +5,10 @@ name: CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - - push: - branches: [ master ] - - pull_request: - branches: [ master ] + push: + branches: [ master ] + pull_request: + branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 6b619cce10055dbb9b9205375607fa83e4eb1c2f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:01:16 -0500 Subject: [PATCH 04/95] stuff --- .github/workflows/main.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10ffcc3efde3..f7f7effbbac2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,7 @@ name: CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -18,7 +14,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-16.04, ubuntu-18.04] - task: [r-package] runs-on: ${{ matrix.os }} # Steps represent a sequence of tasks that will be executed as part of the job @@ -49,9 +44,9 @@ jobs: export OPENCL_VENDOR_PATH=$AMDAPPSDK_PATH/etc/OpenCL/vendors - name: setup env: - TASK: {{ matrix.task }} + TASK: r-package run: bash .ci/setup.sh - name: test env: - TASK: {{ matrix.task }} + TASK: r-package run: bash .ci/test.sh From d83f54d72f78693de42e4ac472d3545829d812b7 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:06:01 -0500 Subject: [PATCH 05/95] directories --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7f7effbbac2..686d57ad3e4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,7 @@ # This is a basic workflow to help you get started with Actions - +# workflow syntax: +# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsenv +# - name: CI # Controls when the action will run. Triggers the workflow on push or pull request @@ -24,7 +26,7 @@ jobs: test -n $CC && unset CC test -n $CXX && unset CXX export HOME_DIRECTORY="$HOME" - export BUILD_DIRECTORY="$TRAVIS_BUILD_DIR" + export BUILD_DIRECTORY="$GITHUB_WORKSPACE" if [[ $TRAVIS_OS_NAME == "osx" ]]; then export OS_NAME="macos"; export COMPILER="gcc"; From 2e8be83026b6d8aace04b465002881dad86bf528 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:06:48 -0500 Subject: [PATCH 06/95] directories --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 686d57ad3e4f..567a681ded77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,9 @@ name: CI # events but only for the master branch on: [push] +env: + GITHUB_ACTIONS: "true" + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" From 275119e586efbaa2218ae67bd47851cdc699ce78 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:09:31 -0500 Subject: [PATCH 07/95] things --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 567a681ded77..6a863ad31efa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,7 @@ jobs: test -n $CC && unset CC test -n $CXX && unset CXX export HOME_DIRECTORY="$HOME" + echo ${GITHUB_WORKSPACE} export BUILD_DIRECTORY="$GITHUB_WORKSPACE" if [[ $TRAVIS_OS_NAME == "osx" ]]; then export OS_NAME="macos"; From 61861066cbcb62a78834ae232fdef12f58abaf7f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:14:26 -0500 Subject: [PATCH 08/95] env variables --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a863ad31efa..1b4752bb3751 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,8 +51,10 @@ jobs: - name: setup env: TASK: r-package + working-directory: ${BUILD_DIRECTORY} run: bash .ci/setup.sh - name: test + working-directory: ${BUILD_DIRECTORY} env: TASK: r-package run: bash .ci/test.sh From faf2e8d6b5ac332d12f89021aee7049744587054 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:15:30 -0500 Subject: [PATCH 09/95] working dir --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b4752bb3751..4e09a1914d8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,10 +51,10 @@ jobs: - name: setup env: TASK: r-package - working-directory: ${BUILD_DIRECTORY} + working-directory: /home/runner/work/LightGBM/LightGBM run: bash .ci/setup.sh - name: test - working-directory: ${BUILD_DIRECTORY} + working-directory: /home/runner/work/LightGBM/LightGBM env: TASK: r-package run: bash .ci/test.sh From b6423d33f1bc8b51b3c47326c5c043c0856b1a12 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:21:08 -0500 Subject: [PATCH 10/95] running a bunch of tasks --- .github/workflows/main.yml | 129 ++++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e09a1914d8b..59db5bd54543 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,60 +1,87 @@ -# This is a basic workflow to help you get started with Actions -# workflow syntax: -# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsenv -# - -name: CI +name: GitHub Actions -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: [push] -env: - GITHUB_ACTIONS: "true" - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: + test: + name: ${{ matrix.task }} (${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-16.04, ubuntu-18.04] - runs-on: ${{ matrix.os }} - - # Steps represent a sequence of tasks that will be executed as part of the job + task: [regular, sdist, bdist, if-else, pylint, mpi-source, mpi-pip, gpu-source, gpu-pip] + os: [ubuntu-latest, macOS-latest, windows-latest] + include: + - task: regular + python_version: 3.6 + - task: sdist + python_version: 2.7 + - task: mpi-source + method: source + - task: mpi-pip + method: pip + - task: gpu-source + method: source + python_version: 3.5 + - task: gpu-pip + method: pip + python_version: 3.6 + exclude: + - os: macOS-latest + task: pylint + - os: macOS-latest + task: gpu-source + - os: macOS-latest + task: gpu-pip + - os: windows-latest + task: if-else + - os: windows-latest + task: pylint + - os: windows-latest + task: mpi-source + - os: windows-latest + task: mpi-pip + - os: windows-latest + task: gpu-source + - os: windows-latest + task: gpu-pip steps: - - uses: actions/checkout@v2 - - name: env_vars + - name: Checkout repository + uses: actions/checkout@v1 + with: + fetch-depth: 1 + submodules: true + - name: Setup and run tests on Linux and macOS + if: matrix.os != 'windows-latest' + shell: bash run: | - test -n $CC && unset CC - test -n $CXX && unset CXX - export HOME_DIRECTORY="$HOME" - echo ${GITHUB_WORKSPACE} - export BUILD_DIRECTORY="$GITHUB_WORKSPACE" - if [[ $TRAVIS_OS_NAME == "osx" ]]; then - export OS_NAME="macos"; - export COMPILER="gcc"; - export R_MAC_VERSION=3.6.3; - else - export OS_NAME="linux"; - export COMPILER="clang"; - export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; - fi - export CONDA="$HOME/miniconda" - export PATH="$CONDA/bin:$PATH" - export CONDA_ENV="test-env" - export LGB_VER=$(head -n 1 VERSION.txt) - export AMDAPPSDK_PATH=$HOME/AMDAPPSDK - export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - export LD_LIBRARY_PATH="/usr/local/clang/lib:$LD_LIBRARY_PATH" # fix error "libomp.so: cannot open shared object file: No such file or directory" on Linux with Clang - export OPENCL_VENDOR_PATH=$AMDAPPSDK_PATH/etc/OpenCL/vendors - - name: setup - env: - TASK: r-package - working-directory: /home/runner/work/LightGBM/LightGBM - run: bash .ci/setup.sh - - name: test - working-directory: /home/runner/work/LightGBM/LightGBM - env: - TASK: r-package - run: bash .ci/test.sh + if [[ "${{ matrix.task }}" == "gpu-source" || "${{ matrix.task }}" == "gpu-pip" ]]; then + export TASK="gpu" + elif [[ "${{ matrix.task }}" == "mpi-source" || "${{ matrix.task }}" == "mpi-pip" ]]; then + export TASK="mpi" + fi + export METHOD="${{ matrix.method }}" + if [ -z ${{ matrix.python_version }} ]; then + export PYTHON_VERSION="3.7" + else + export PYTHON_VERSION=${{ matrix.python_version }} + fi + + export HOME_DIRECTORY="$HOME" + export BUILD_DIRECTORY="$GITHUB_WORKSPACE" + if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then + export OS_NAME="macos" + export COMPILER="gcc" + elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + export OS_NAME="linux" + export COMPILER="clang" + fi + export GITHUB_ACTIONS="true" + export CONDA_ENV="test-env" + export LGB_VER=$(head -n 1 VERSION.txt) + export AMDAPPSDK_PATH=$HOME/AMDAPPSDK + export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" + export OPENCL_VENDOR_PATH=$AMDAPPSDK_PATH/etc/OpenCL/vendors + + $GITHUB_WORKSPACE/.ci/setup.sh + $GITHUB_WORKSPACE/.ci/test.sh From 482ae939088e74e8bf29d7dccab495f52ff78b69 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:25:30 -0500 Subject: [PATCH 11/95] more builds --- .github/workflows/main.yml | 51 +++----------------------------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59db5bd54543..ddbc68bf5dd2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,42 +9,13 @@ jobs: strategy: fail-fast: false matrix: - task: [regular, sdist, bdist, if-else, pylint, mpi-source, mpi-pip, gpu-source, gpu-pip] + task: [lint, r-package] os: [ubuntu-latest, macOS-latest, windows-latest] - include: - - task: regular - python_version: 3.6 - - task: sdist - python_version: 2.7 - - task: mpi-source - method: source - - task: mpi-pip - method: pip - - task: gpu-source - method: source - python_version: 3.5 - - task: gpu-pip - method: pip - python_version: 3.6 exclude: - os: macOS-latest - task: pylint - - os: macOS-latest - task: gpu-source - - os: macOS-latest - task: gpu-pip - - os: windows-latest - task: if-else - - os: windows-latest - task: pylint - - os: windows-latest - task: mpi-source - - os: windows-latest - task: mpi-pip + task: lint - os: windows-latest - task: gpu-source - - os: windows-latest - task: gpu-pip + task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -55,18 +26,7 @@ jobs: if: matrix.os != 'windows-latest' shell: bash run: | - if [[ "${{ matrix.task }}" == "gpu-source" || "${{ matrix.task }}" == "gpu-pip" ]]; then - export TASK="gpu" - elif [[ "${{ matrix.task }}" == "mpi-source" || "${{ matrix.task }}" == "mpi-pip" ]]; then - export TASK="mpi" - fi - export METHOD="${{ matrix.method }}" - if [ -z ${{ matrix.python_version }} ]; then - export PYTHON_VERSION="3.7" - else - export PYTHON_VERSION=${{ matrix.python_version }} - fi - + export TASK="{{ matrix.task }}" export HOME_DIRECTORY="$HOME" export BUILD_DIRECTORY="$GITHUB_WORKSPACE" if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then @@ -79,9 +39,6 @@ jobs: export GITHUB_ACTIONS="true" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) - export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - export OPENCL_VENDOR_PATH=$AMDAPPSDK_PATH/etc/OpenCL/vendors - $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh From 6f783d8ea956c703b04c60090408987dfb667959 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:29:23 -0500 Subject: [PATCH 12/95] PATH --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ddbc68bf5dd2..2c52c58fe150 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,9 +36,12 @@ jobs: export OS_NAME="linux" export COMPILER="clang" fi + export CONDA="$HOME/miniconda" + export PATH="$CONDA/bin:$PATH" export GITHUB_ACTIONS="true" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) + export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh From 48eb0efd28c91b1727d01a8cc75ef8b552f7c2e1 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:36:33 -0500 Subject: [PATCH 13/95] actually use R task --- .ci/test.sh | 4 ++-- .github/workflows/main.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 7c68ca733fe9..b64cc510a505 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -13,7 +13,7 @@ source activate $CONDA_ENV cd $BUILD_DIRECTORY -if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then +if [[ $TASK == "check-docs" ]]; then cd $BUILD_DIRECTORY/docs conda install -q -y -n $CONDA_ENV -c conda-forge doxygen pip install --user -r requirements.txt rstcheck @@ -40,7 +40,7 @@ if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then exit 0 fi -if [[ $TRAVIS == "true" ]] && [[ $TASK == "lint" ]]; then +if [[ $TASK == "lint" ]]; then conda install -q -y -n $CONDA_ENV \ pycodestyle \ pydocstyle \ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c52c58fe150..7f21466aeb15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,5 +43,6 @@ jobs: export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" + echo "--- TASK: ${TASK}" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh From 8bef95c223878beba178337471e0f0144f1366f2 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:39:44 -0500 Subject: [PATCH 14/95] TASK --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f21466aeb15..f13a833433bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: if: matrix.os != 'windows-latest' shell: bash run: | - export TASK="{{ matrix.task }}" + export TASK="${{ matrix.task }}" export HOME_DIRECTORY="$HOME" export BUILD_DIRECTORY="$GITHUB_WORKSPACE" if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then @@ -44,5 +44,10 @@ jobs: export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" echo "--- TASK: ${TASK}" - $GITHUB_WORKSPACE/.ci/setup.sh - $GITHUB_WORKSPACE/.ci/test.sh + - name: run tests + if: matrix.os != 'windows-latest' + shell: bash + run: | + + $GITHUB_WORKSPACE/.ci/setup.sh + $GITHUB_WORKSPACE/.ci/test.sh From e515ae704e924bbe5865500b04b3336721b1794d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 21:41:16 -0500 Subject: [PATCH 15/95] be right, often --- .github/workflows/main.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f13a833433bd..3b98ded6eade 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,11 +43,5 @@ jobs: export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - echo "--- TASK: ${TASK}" - - name: run tests - if: matrix.os != 'windows-latest' - shell: bash - run: | - - $GITHUB_WORKSPACE/.ci/setup.sh - $GITHUB_WORKSPACE/.ci/test.sh + $GITHUB_WORKSPACE/.ci/setup.sh + $GITHUB_WORKSPACE/.ci/test.sh From deda7f61276e6d1cd40f12ec864837d3380ee418 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:07:30 -0500 Subject: [PATCH 16/95] doing stuff --- .ci/test_r_package.sh | 2 +- .github/workflows/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index fcd515d23c18..d9377857a518 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -13,7 +13,7 @@ export PATH="$R_LIB_PATH/R/bin:$PATH" # # This only needs to get run on Travis because R environment for Linux # used by Azure pipelines is set up in https://github.com/guolinke/lightgbm-ci-docker -if [[ $TRAVIS == "true" ]] && [[ $OS_NAME == "linux" ]]; then +if [[ $AZURE != "true" ]] && [[ $OS_NAME == "linux" ]]; then sudo apt-key adv \ --keyserver keyserver.ubuntu.com \ --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b98ded6eade..f97a2ee57db7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,7 @@ jobs: fi export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:$PATH" + echo "COONDA: $CONDA" export GITHUB_ACTIONS="true" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) From 1f00cd26265a8e79f5f6f8471d0771d83b2168c3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:09:46 -0500 Subject: [PATCH 17/95] trying stuff --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f97a2ee57db7..60712f12b02d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,8 @@ jobs: fi export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:$PATH" - echo "COONDA: $CONDA" + echo "PATH: $PATH" + which activate export GITHUB_ACTIONS="true" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) From da5de22d4685831a510537b1d14f4ce900196deb Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:13:14 -0500 Subject: [PATCH 18/95] more paths --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60712f12b02d..dccec6b95e12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - task: [lint, r-package] + task: [lint] # r-package os: [ubuntu-latest, macOS-latest, windows-latest] exclude: - os: macOS-latest @@ -36,11 +36,9 @@ jobs: export OS_NAME="linux" export COMPILER="clang" fi + export GITHUB_ACTIONS="true" export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:$PATH" - echo "PATH: $PATH" - which activate - export GITHUB_ACTIONS="true" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK From 115bbe16d1a61e5761770c22d9a386fb7ce8ef4e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:16:07 -0500 Subject: [PATCH 19/95] conda activate --- .ci/test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index b64cc510a505..775df84179a9 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -9,7 +9,8 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then fi conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION -source activate $CONDA_ENV +#source activate $CONDA_ENV +conda activate $CONDA_ENV cd $BUILD_DIRECTORY From 8822deffac62e69d5641dcff37b46d86542741db Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:19:15 -0500 Subject: [PATCH 20/95] updating PATH --- .ci/test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 775df84179a9..8e9f573f275e 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -9,8 +9,7 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then fi conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION -#source activate $CONDA_ENV -conda activate $CONDA_ENV +source ${CONDA}/bin/activate $CONDA_ENV cd $BUILD_DIRECTORY From d741afcb05a80d96335fdb660e97fd4a752b2b72 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:23:10 -0500 Subject: [PATCH 21/95] trying bash --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dccec6b95e12..ed3394815a97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,5 +43,5 @@ jobs: export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - $GITHUB_WORKSPACE/.ci/setup.sh - $GITHUB_WORKSPACE/.ci/test.sh + bash $GITHUB_WORKSPACE/.ci/setup.sh + bash $GITHUB_WORKSPACE/.ci/test.sh From 4828392fc9912346994ccbcf639775017cd5d63c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:33:05 -0500 Subject: [PATCH 22/95] where the hell is activate --- .ci/test.sh | 2 +- .github/workflows/main.yml | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 8e9f573f275e..b64cc510a505 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -9,7 +9,7 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then fi conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION -source ${CONDA}/bin/activate $CONDA_ENV +source activate $CONDA_ENV cd $BUILD_DIRECTORY diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed3394815a97..608dea22680d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,9 +39,16 @@ jobs: export GITHUB_ACTIONS="true" export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:$PATH" + echo '----- CONDA/bin -----' + ls $CONDA/bin + echo '----- CONDA -----' + ls $CONDA + echo '----- PATH -----' + echo "PATH: $PATH" + echo '--------------' export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - bash $GITHUB_WORKSPACE/.ci/setup.sh - bash $GITHUB_WORKSPACE/.ci/test.sh + $GITHUB_WORKSPACE/.ci/setup.sh + $GITHUB_WORKSPACE/.ci/test.sh From ceb2ff2c9e1771fa117b3c593ffaa5bccadab5ae Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:35:59 -0500 Subject: [PATCH 23/95] WHERE IS ACTIVATE --- .ci/setup.sh | 8 ++++++++ .github/workflows/main.yml | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.ci/setup.sh b/.ci/setup.sh index 0c4101189346..1fcc773f98f5 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -46,3 +46,11 @@ if [[ $TRAVIS == "true" ]] || [[ $OS_NAME == "macos" ]]; then fi conda config --set always_yes yes --set changeps1 no conda update -q -y conda + +echo '----- CONDA/bin -----' +ls $CONDA/bin +echo '----- CONDA -----' +ls $CONDA +echo '----- PATH -----' +echo "PATH: $PATH" +echo '--------------' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 608dea22680d..dccec6b95e12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,13 +39,6 @@ jobs: export GITHUB_ACTIONS="true" export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:$PATH" - echo '----- CONDA/bin -----' - ls $CONDA/bin - echo '----- CONDA -----' - ls $CONDA - echo '----- PATH -----' - echo "PATH: $PATH" - echo '--------------' export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK From 3c5a64ec1b793db2da7f1158383bdd65f0890da4 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:39:18 -0500 Subject: [PATCH 24/95] set up conda --- .ci/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/setup.sh b/.ci/setup.sh index 1fcc773f98f5..d0487b4c6ba7 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -36,7 +36,7 @@ else # Linux mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/ echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd fi - if [[ $TRAVIS == "true" ]]; then + if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIOONS == "true" ]]; then wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh fi fi From b0197353d9d87a57f2c2a1a0df89fc6ee6ff06fc Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:40:52 -0500 Subject: [PATCH 25/95] more conda --- .ci/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/setup.sh b/.ci/setup.sh index d0487b4c6ba7..faadb227d9a9 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -41,7 +41,7 @@ else # Linux fi fi -if [[ $TRAVIS == "true" ]] || [[ $OS_NAME == "macos" ]]; then +if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]] || [[ $OS_NAME == "macos" ]]; then sh conda.sh -b -p $CONDA fi conda config --set always_yes yes --set changeps1 no From a8340c86d240f5cc6ba4f2f11da09963d01bf5e4 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:42:55 -0500 Subject: [PATCH 26/95] PLEASE WORK --- .ci/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/setup.sh b/.ci/setup.sh index faadb227d9a9..b04889c53e22 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -36,7 +36,7 @@ else # Linux mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/ echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd fi - if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIOONS == "true" ]]; then + if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]]; then wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh fi fi From 106402b7cce31aee3ae97caed65045a50627179d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:47:19 -0500 Subject: [PATCH 27/95] installing cpplint --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dccec6b95e12..58f07b4b623b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: fi export GITHUB_ACTIONS="true" export CONDA="$HOME/miniconda" - export PATH="$CONDA/bin:$PATH" + export PATH="$CONDA/bin:${HOME}/.local/bin:$PATH" export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) export AMDAPPSDK_PATH=$HOME/AMDAPPSDK From ebff0f670dce59e75404feeab0e11198ec521015 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:51:50 -0500 Subject: [PATCH 28/95] try r-package --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58f07b4b623b..9280080ee3a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - task: [lint] # r-package + task: [lint, r-package] os: [ubuntu-latest, macOS-latest, windows-latest] exclude: - os: macOS-latest From 0626247577d4a4cb3e759b4af9ffdda0d2d8bc38 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 22:57:02 -0500 Subject: [PATCH 29/95] R version --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9280080ee3a4..1ac6f6ea55a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,17 @@ jobs: if: matrix.os != 'windows-latest' shell: bash run: | + export HOME_DIRECTORY="$HOME" + export BUILD_DIRECTORY="$GITHUB_WORKSPACE" + if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then + export OS_NAME="macos" + export COMPILER="gcc" + export R_MAC_VERSION=3.6.3 + elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + export OS_NAME="linux" + export COMPILER="clang" + export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; + fi export TASK="${{ matrix.task }}" export HOME_DIRECTORY="$HOME" export BUILD_DIRECTORY="$GITHUB_WORKSPACE" From b627d82f8ee6f2de4914df54aadb33a945c75b0a Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:15:49 -0500 Subject: [PATCH 30/95] try windows job --- .ci/test_windows.ps1 | 2 ++ .github/workflows/main.yml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index fd0e9f95a5e4..dbee579ef812 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -10,6 +10,8 @@ function Check-Output { if (Test-Path env:APPVEYOR) { $env:APPVEYOR = "true" $env:BUILD_SOURCESDIRECTORY = $env:APPVEYOR_BUILD_FOLDER +} elseif ($env:APPVEYOR -eq "true") { + $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } if ($env:TASK -eq "r-package") { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ac6f6ea55a1..41bdee2f23f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,16 @@ jobs: matrix: task: [lint, r-package] os: [ubuntu-latest, macOS-latest, windows-latest] + include: + - os: ubuntu-latest + task: r-package + - os: macOS-latest + task: r-package + - os: windows-latest + task: r-package + compiler: MINGW + - os: ubuntu-latest + task: lint exclude: - os: macOS-latest task: lint @@ -37,6 +47,9 @@ jobs: export COMPILER="clang" export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; fi + if [ -z ${{ matrix.compiler }} ]; then + export COMPILER=${{ matrix.compiler }} + fi export TASK="${{ matrix.task }}" export HOME_DIRECTORY="$HOME" export BUILD_DIRECTORY="$GITHUB_WORKSPACE" @@ -56,3 +69,12 @@ jobs: export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh + - name: Setup and run tests on Windows + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + $env:HOME_DIRECTORY=$env:HOME + $env:GITHUB_ACTIONS="true" + $env:CONDA_ENV="test-env" + & "conda init powershell" + & "powershell -ExecutionPolicy Bypass -File %BUILD_DIRECTORY%/.ci/test_windows.ps1" From 05b9b87d5ff7d7c03295bd80af9951d4382f4d7b Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:20:57 -0500 Subject: [PATCH 31/95] make windows work --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41bdee2f23f9..93277e7c09b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,6 +75,4 @@ jobs: run: | $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" - $env:CONDA_ENV="test-env" - & "conda init powershell" & "powershell -ExecutionPolicy Bypass -File %BUILD_DIRECTORY%/.ci/test_windows.ps1" From dcefc10bfc6582cf719c56bfd5703ebf7efc0718 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:23:01 -0500 Subject: [PATCH 32/95] use powershell --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93277e7c09b0..bf0e6e2e9855 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: $GITHUB_WORKSPACE/.ci/test.sh - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: pwsh + shell: cmd run: | $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" From 1ce1a97e101137c2b45b6ae69c61a1d354ad2196 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:26:37 -0500 Subject: [PATCH 33/95] exe --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf0e6e2e9855..a93b018a7ed9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,4 +75,4 @@ jobs: run: | $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" - & "powershell -ExecutionPolicy Bypass -File %BUILD_DIRECTORY%/.ci/test_windows.ps1" + powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From 7c08d5dc160f00cf4fc995ca8fe8e1fedbb6dc8e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:50:20 -0500 Subject: [PATCH 34/95] use conda --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a93b018a7ed9..449ca80d3a9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: task: [lint, r-package] - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [windows-latest] # ubuntu-latest, macOS-latest, include: - os: ubuntu-latest task: r-package @@ -69,6 +69,12 @@ jobs: export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh + # reference: https://github.com/marketplace/actions/setup-conda + - name: Use conda on Windows + if: matrix.os == 'windows-latest' + uses: s-weigand/setup-conda@v1 + with: + activate-conda: true - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: cmd From ee1c6c36eeb4de63be9347a0c77de0c74e9bbd5f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 21 May 2020 23:57:51 -0500 Subject: [PATCH 35/95] conda init powershell --- .github/workflows/main.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 449ca80d3a9b..3bb91a039f5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,23 +9,21 @@ jobs: strategy: fail-fast: false matrix: - task: [lint, r-package] - os: [windows-latest] # ubuntu-latest, macOS-latest, include: - - os: ubuntu-latest - task: r-package - - os: macOS-latest - task: r-package + # - os: ubuntu-latest + # task: r-package + # - os: macOS-latest + # task: r-package - os: windows-latest task: r-package compiler: MINGW - - os: ubuntu-latest - task: lint - exclude: - - os: macOS-latest - task: lint - - os: windows-latest - task: lint + # - os: ubuntu-latest + # task: lint + # exclude: + # - os: macOS-latest + # task: lint + # - os: windows-latest + # task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -81,4 +79,5 @@ jobs: run: | $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" + conda init powershell powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From 72240c4f6bfae2988f47836e0991933f7aef51a0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 00:09:50 -0500 Subject: [PATCH 36/95] different conda approach --- .appveyor.yml | 2 -- .github/workflows/main.yml | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index f27fa78fb89c..5aa149bfe5d3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,8 +13,6 @@ branches: environment: matrix: - - COMPILER: MINGW - TASK: r-package - COMPILER: MSVC TASK: r-package APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bb91a039f5c..8f35b17e1605 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,12 +67,18 @@ jobs: export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh - # reference: https://github.com/marketplace/actions/setup-conda + # # reference: https://github.com/marketplace/actions/setup-conda + # - name: Use conda on Windows + # if: matrix.os == 'windows-latest' + # uses: s-weigand/setup-conda@v1 + # with: + # activate-conda: true + # https://github.com/marketplace/actions/setup-miniconda - name: Use conda on Windows if: matrix.os == 'windows-latest' - uses: s-weigand/setup-conda@v1 + uses: goanpeca/setup-miniconda@v1 with: - activate-conda: true + auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: cmd From 2ec68085a062462354d6627d763bcdccbe74a973 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 00:13:36 -0500 Subject: [PATCH 37/95] make it work --- .ci/test_windows.ps1 | 2 +- .github/workflows/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index dbee579ef812..04df3f2970a7 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -10,7 +10,7 @@ function Check-Output { if (Test-Path env:APPVEYOR) { $env:APPVEYOR = "true" $env:BUILD_SOURCESDIRECTORY = $env:APPVEYOR_BUILD_FOLDER -} elseif ($env:APPVEYOR -eq "true") { +} elseif ($env:GITHUB_ACTIONS -eq "true") { $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f35b17e1605..1e8228ea31e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,5 +85,6 @@ jobs: run: | $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" + $env:TASK="r-package" conda init powershell powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From d5a97b916180b5e52afcd6c8f76d09dc5c39ecd7 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 00:21:18 -0500 Subject: [PATCH 38/95] cleaning up --- .ci/setup.sh | 8 -------- .ci/test_r_package_windows.ps1 | 2 ++ .ci/test_windows.ps1 | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.ci/setup.sh b/.ci/setup.sh index b04889c53e22..73adee173ca8 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -46,11 +46,3 @@ if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]] || [[ $OS_NAME == fi conda config --set always_yes yes --set changeps1 no conda update -q -y conda - -echo '----- CONDA/bin -----' -ls $CONDA/bin -echo '----- CONDA -----' -ls $CONDA -echo '----- PATH -----' -echo "PATH: $PATH" -echo '--------------' diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 966cc3dc0e91..3e4d1b2b1e2d 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -12,6 +12,8 @@ function Download-File-With-Retries { } while(!$?); } +Write-Output "schmibberty" + $env:R_WINDOWS_VERSION = "3.6.3" $env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' $env:R_LIBS = "$env:R_LIB_PATH" diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 04df3f2970a7..68534b0ff80b 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -5,16 +5,20 @@ function Check-Output { Exit -1 } } +Write-Output "here" # unify environment variables for Azure devops and AppVeyor if (Test-Path env:APPVEYOR) { $env:APPVEYOR = "true" $env:BUILD_SOURCESDIRECTORY = $env:APPVEYOR_BUILD_FOLDER } elseif ($env:GITHUB_ACTIONS -eq "true") { + Write-Output "there" $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } +Write-Output "libberty" if ($env:TASK -eq "r-package") { + Write-Output "bibberty" & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? Exit 0 } From 9372b4100729391095facbfd7e0299657ed2ecea Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 00:25:24 -0500 Subject: [PATCH 39/95] init powershell --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e8228ea31e7..1fc486de1ad1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,6 +79,10 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: auto-update-conda: false + - name: conda init powershell + if: matrix.os == 'windows-latest' + shell: cmd + run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: cmd @@ -86,5 +90,4 @@ jobs: $env:HOME_DIRECTORY=$env:HOME $env:GITHUB_ACTIONS="true" $env:TASK="r-package" - conda init powershell powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From 56e94e6cf8e26666734be2aea6436f27a81b51fe Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:08:31 -0500 Subject: [PATCH 40/95] fixing windows --- .ci/test_windows.ps1 | 5 +---- .github/workflows/main.yml | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 68534b0ff80b..885a37f2e59a 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -5,20 +5,17 @@ function Check-Output { Exit -1 } } -Write-Output "here" # unify environment variables for Azure devops and AppVeyor if (Test-Path env:APPVEYOR) { $env:APPVEYOR = "true" $env:BUILD_SOURCESDIRECTORY = $env:APPVEYOR_BUILD_FOLDER } elseif ($env:GITHUB_ACTIONS -eq "true") { - Write-Output "there" $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } -Write-Output "libberty" if ($env:TASK -eq "r-package") { - Write-Output "bibberty" + Write-Output "libberty" & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? Exit 0 } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fc486de1ad1..df2ad2ab2ea1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,7 +87,17 @@ jobs: if: matrix.os == 'windows-latest' shell: cmd run: | - $env:HOME_DIRECTORY=$env:HOME - $env:GITHUB_ACTIONS="true" - $env:TASK="r-package" + set HOME_DIRECTORY=%HOME% + set GITHUB_ACTIONS="true" + set TASK="r-package" powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + +# links +# * https://github.com/microsoft/LightGBM/issues/2353 +# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun +# * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners +# * https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable +# * https://github.com/marketplace/actions/setup-miniconda +# * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources +# * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md +# * From 22c082fb3a134942fca6556aaf68ab9821dc6e3e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:14:53 -0500 Subject: [PATCH 41/95] more windows --- .ci/test_windows.ps1 | 1 + .github/workflows/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 885a37f2e59a..886c83ed7e78 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -14,6 +14,7 @@ if (Test-Path env:APPVEYOR) { $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } +Write-Output "TASK: $env:TASK" if ($env:TASK -eq "r-package") { Write-Output "libberty" & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df2ad2ab2ea1..1e183dc6844f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,10 +86,10 @@ jobs: - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: cmd + env: + GITHUB_ACTIONS: "true" + TASK: "r-package" run: | - set HOME_DIRECTORY=%HOME% - set GITHUB_ACTIONS="true" - set TASK="r-package" powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 # links From b4f96e17fea5d8c5e79897bd3a15376f6ca4383c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:25:52 -0500 Subject: [PATCH 42/95] build directory --- .ci/test_r_package_windows.ps1 | 1 + .ci/test_windows.ps1 | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 3e4d1b2b1e2d..509565155373 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -13,6 +13,7 @@ function Download-File-With-Retries { } Write-Output "schmibberty" +Write-Output "BUILD_SOURCESDIRECTORY (test-r): $env:BUILD_SOURCESDIRECTORY" $env:R_WINDOWS_VERSION = "3.6.3" $env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 886c83ed7e78..ceb9d6d975d2 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -13,10 +13,9 @@ if (Test-Path env:APPVEYOR) { } elseif ($env:GITHUB_ACTIONS -eq "true") { $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } +Write-Output "BUILD_SOURCESDIRECTORY (test): $env:BUILD_SOURCESDIRECTORY" -Write-Output "TASK: $env:TASK" if ($env:TASK -eq "r-package") { - Write-Output "libberty" & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? Exit 0 } From 2b24d8c261fce1f9429212e6a4e2b9a20d43a052 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:34:24 -0500 Subject: [PATCH 43/95] no way right --- .ci/test_r_package_windows.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 509565155373..89060339fa6d 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -70,7 +70,9 @@ if ($env:COMPILER -eq "MINGW") { Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? + +# have to divert stderr to null because GitHub Actions treats writing to stderr as a failed task +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" 2> $null ; Check-Output $? Write-Output "Building R package" From 1a63eefe39c0abe57b66f3364b9c9d7fb15a9514 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:41:29 -0500 Subject: [PATCH 44/95] maybe it will work --- .ci/test_r_package_windows.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 89060339fa6d..078472b6f380 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -12,7 +12,6 @@ function Download-File-With-Retries { } while(!$?); } -Write-Output "schmibberty" Write-Output "BUILD_SOURCESDIRECTORY (test-r): $env:BUILD_SOURCESDIRECTORY" $env:R_WINDOWS_VERSION = "3.6.3" @@ -72,7 +71,7 @@ Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" # have to divert stderr to null because GitHub Actions treats writing to stderr as a failed task -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" 2> $null ; Check-Output $? +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" 2> $null # ; Check-Output $? Write-Output "Building R package" From 54a58c39c829a5d66ec04c8bf11902585f2b2974 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 21:53:48 -0500 Subject: [PATCH 45/95] trying Visual Studio --- .appveyor.yml | 10 +++++----- .ci/test_r_package_windows.ps1 | 8 ++------ .ci/test_windows.ps1 | 1 - .github/workflows/main.yml | 8 +++----- .travis.yml | 20 ++++++++++---------- 5 files changed, 20 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5aa149bfe5d3..1ce545ac0121 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,11 +13,11 @@ branches: environment: matrix: - - COMPILER: MSVC - TASK: r-package - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - - COMPILER: MSVC - TASK: python + # - COMPILER: MSVC + # TASK: r-package + # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + # - COMPILER: MSVC + # TASK: python - COMPILER: MINGW TASK: python diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 078472b6f380..4657d8fe3ae5 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -12,8 +12,6 @@ function Download-File-With-Retries { } while(!$?); } -Write-Output "BUILD_SOURCESDIRECTORY (test-r): $env:BUILD_SOURCESDIRECTORY" - $env:R_WINDOWS_VERSION = "3.6.3" $env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' $env:R_LIBS = "$env:R_LIB_PATH" @@ -52,7 +50,7 @@ Write-Output "Done installing Rtools" # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those -if ($env:COMPILER -eq "MINGW") { +if ($env:COMPILER -ne "MSVC") { Write-Output "Downloading MiKTeX" Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem @@ -69,9 +67,7 @@ if ($env:COMPILER -eq "MINGW") { Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" - -# have to divert stderr to null because GitHub Actions treats writing to stderr as a failed task -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" 2> $null # ; Check-Output $? +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" Write-Output "Building R package" diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index ceb9d6d975d2..04df3f2970a7 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -13,7 +13,6 @@ if (Test-Path env:APPVEYOR) { } elseif ($env:GITHUB_ACTIONS -eq "true") { $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } -Write-Output "BUILD_SOURCESDIRECTORY (test): $env:BUILD_SOURCESDIRECTORY" if ($env:TASK -eq "r-package") { & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e183dc6844f..2083bba36010 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,13 +17,11 @@ jobs: - os: windows-latest task: r-package compiler: MINGW + - os: windows-latest + task: r-package + compiler: MSVC # - os: ubuntu-latest # task: lint - # exclude: - # - os: macOS-latest - # task: lint - # - os: windows-latest - # task: lint steps: - name: Checkout repository uses: actions/checkout@v1 diff --git a/.travis.yml b/.travis.yml index 44cd1f6b00f0..3f0d99190687 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,17 +14,17 @@ env: global: # default values - PYTHON_VERSION=3.8 matrix: - - TASK=regular PYTHON_VERSION=3.6 - - TASK=sdist PYTHON_VERSION=2.7 - - TASK=bdist - - TASK=if-else + # - TASK=regular PYTHON_VERSION=3.6 + # - TASK=sdist PYTHON_VERSION=2.7 + # - TASK=bdist + # - TASK=if-else - TASK=lint - - TASK=check-docs - - TASK=mpi METHOD=source - - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 - - TASK=gpu METHOD=source PYTHON_VERSION=3.5 - - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 - - TASK=r-package + # - TASK=check-docs + # - TASK=mpi METHOD=source + # - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 + # - TASK=gpu METHOD=source PYTHON_VERSION=3.5 + # - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 + # - TASK=r-package matrix: exclude: From 045d5304ec3f0941422026ba962e64961fb479fd Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 22:20:08 -0500 Subject: [PATCH 46/95] do this --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2083bba36010..6096bdc88990 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: GITHUB_ACTIONS: "true" TASK: "r-package" run: | - powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + powershell.exe -ExecutionPolicy Bypass ErrorActionPreference Continue -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 # links # * https://github.com/microsoft/LightGBM/issues/2353 @@ -98,4 +98,4 @@ jobs: # * https://github.com/marketplace/actions/setup-miniconda # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md -# * +# * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide From 68a17ee73817d201cf2bb5c713b8d4e14dc59b17 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 22:49:06 -0500 Subject: [PATCH 47/95] Windows is interesting --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6096bdc88990..2de8a0828812 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,12 +83,12 @@ jobs: run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: cmd + shell: pwsh env: GITHUB_ACTIONS: "true" TASK: "r-package" run: | - powershell.exe -ExecutionPolicy Bypass ErrorActionPreference Continue -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links # * https://github.com/microsoft/LightGBM/issues/2353 From eb75583af1f4133a99098d72ae24f4ddf434eb6d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 22:59:54 -0500 Subject: [PATCH 48/95] put back check-output --- .ci/test_r_package_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 4657d8fe3ae5..eb09bdf28dae 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -67,7 +67,7 @@ if ($env:COMPILER -ne "MSVC") { Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? Write-Output "Building R package" From 81e387ec71a8fe389e3cd6560e75748b5e3a7deb Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 23:06:29 -0500 Subject: [PATCH 49/95] set compiler --- .github/workflows/main.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2de8a0828812..b16db00ee9fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,8 +20,8 @@ jobs: - os: windows-latest task: r-package compiler: MSVC - # - os: ubuntu-latest - # task: lint + - os: ubuntu-latest + task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -32,8 +32,6 @@ jobs: if: matrix.os != 'windows-latest' shell: bash run: | - export HOME_DIRECTORY="$HOME" - export BUILD_DIRECTORY="$GITHUB_WORKSPACE" if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then export OS_NAME="macos" export COMPILER="gcc" @@ -65,12 +63,6 @@ jobs: export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh - # # reference: https://github.com/marketplace/actions/setup-conda - # - name: Use conda on Windows - # if: matrix.os == 'windows-latest' - # uses: s-weigand/setup-conda@v1 - # with: - # activate-conda: true # https://github.com/marketplace/actions/setup-miniconda - name: Use conda on Windows if: matrix.os == 'windows-latest' @@ -88,6 +80,9 @@ jobs: GITHUB_ACTIONS: "true" TASK: "r-package" run: | + if ("${{ matrix.compiler }}" -ne "") { + $env:COMPILER = "${{ matrix.compiler }}" + } & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links From f2a0d1078032e5edc5e1dd400ed6f74dc1d2d2d3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 23:25:58 -0500 Subject: [PATCH 50/95] stuff --- .github/workflows/main.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b16db00ee9fb..008f838694c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,11 +17,11 @@ jobs: - os: windows-latest task: r-package compiler: MINGW - - os: windows-latest - task: r-package - compiler: MSVC - - os: ubuntu-latest - task: lint + # - os: windows-latest + # task: r-package + # compiler: MSVC + # - os: ubuntu-latest + # task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -86,11 +86,9 @@ jobs: & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links -# * https://github.com/microsoft/LightGBM/issues/2353 -# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun +# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # * https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable # * https://github.com/marketplace/actions/setup-miniconda # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md -# * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide From 5b786ed8c1d2f6c800a30e651c0757e29930c8fc Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 23:33:50 -0500 Subject: [PATCH 51/95] more fixes --- .ci/test_r_package_windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index eb09bdf28dae..3f899be11c83 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -67,12 +67,12 @@ if ($env:COMPILER -ne "MSVC") { Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? Write-Output "Building R package" # R CMD check is not used for MSVC builds -if ($env:COMPILER -ne "MSVC") { +if ($env:COMPILER -eq "MINGW") { Rscript build_r.R --skip-install ; Check-Output $? $PKG_FILE_NAME = Get-Item *.tar.gz From 38f5e5dbb9c605350245275d69509ad766105550 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 23:42:10 -0500 Subject: [PATCH 52/95] fix the broken things --- .ci/test_r_package_windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 3f899be11c83..966cc3dc0e91 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -50,7 +50,7 @@ Write-Output "Done installing Rtools" # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those -if ($env:COMPILER -ne "MSVC") { +if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem @@ -72,7 +72,7 @@ Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.pac Write-Output "Building R package" # R CMD check is not used for MSVC builds -if ($env:COMPILER -eq "MINGW") { +if ($env:COMPILER -ne "MSVC") { Rscript build_r.R --skip-install ; Check-Output $? $PKG_FILE_NAME = Get-Item *.tar.gz From a384208d996a6e424b86c363803ece4f64a4e633 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 22 May 2020 23:56:25 -0500 Subject: [PATCH 53/95] updating jobs --- .appveyor.yml | 7 ++----- .ci/test_windows.ps1 | 2 -- .github/workflows/main.yml | 19 ++++++++++--------- .travis.yml | 21 ++++++++++----------- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1ce545ac0121..f3404faa68b9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,11 +13,8 @@ branches: environment: matrix: - # - COMPILER: MSVC - # TASK: r-package - # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - # - COMPILER: MSVC - # TASK: python + - COMPILER: MSVC + TASK: python - COMPILER: MINGW TASK: python diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 04df3f2970a7..fd0e9f95a5e4 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -10,8 +10,6 @@ function Check-Output { if (Test-Path env:APPVEYOR) { $env:APPVEYOR = "true" $env:BUILD_SOURCESDIRECTORY = $env:APPVEYOR_BUILD_FOLDER -} elseif ($env:GITHUB_ACTIONS -eq "true") { - $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE } if ($env:TASK -eq "r-package") { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 008f838694c7..ba765439d667 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,18 +10,18 @@ jobs: fail-fast: false matrix: include: - # - os: ubuntu-latest - # task: r-package - # - os: macOS-latest - # task: r-package + - os: ubuntu-latest + task: r-package + - os: macOS-latest + task: r-package - os: windows-latest task: r-package compiler: MINGW - # - os: windows-latest - # task: r-package - # compiler: MSVC - # - os: ubuntu-latest - # task: lint + - os: windows-latest + task: r-package + compiler: MSVC + - os: ubuntu-latest + task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -83,6 +83,7 @@ jobs: if ("${{ matrix.compiler }}" -ne "") { $env:COMPILER = "${{ matrix.compiler }}" } + $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links diff --git a/.travis.yml b/.travis.yml index 3f0d99190687..a00b250660b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,17 +14,16 @@ env: global: # default values - PYTHON_VERSION=3.8 matrix: - # - TASK=regular PYTHON_VERSION=3.6 - # - TASK=sdist PYTHON_VERSION=2.7 - # - TASK=bdist - # - TASK=if-else - - TASK=lint - # - TASK=check-docs - # - TASK=mpi METHOD=source - # - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 - # - TASK=gpu METHOD=source PYTHON_VERSION=3.5 - # - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 - # - TASK=r-package + - TASK=regular PYTHON_VERSION=3.6 + - TASK=sdist PYTHON_VERSION=2.7 + - TASK=bdist + - TASK=if-else + - TASK=check-docs + - TASK=mpi METHOD=source + - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 + - TASK=gpu METHOD=source PYTHON_VERSION=3.5 + - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 + - TASK=r-package matrix: exclude: From 20ad23ed6285fb3199d6ffd7ca3f149c59bcf79f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:05:45 -0500 Subject: [PATCH 54/95] continuing --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba765439d667..05d5afef89c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,11 +79,15 @@ jobs: env: GITHUB_ACTIONS: "true" TASK: "r-package" + # https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide + # https://stackoverflow.com/a/11826589/3986677 run: | if ("${{ matrix.compiler }}" -ne "") { $env:COMPILER = "${{ matrix.compiler }}" } $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + Write-Output "CI default for Errors: $ErrorActionPreference" + $ErrorActionPreference = "Continue" & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links From 39fdc4fdac3958711b4080589fc4a42fafa3b279 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:16:24 -0500 Subject: [PATCH 55/95] poweshell is bad --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05d5afef89c4..f53fd5cfea3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE Write-Output "CI default for Errors: $ErrorActionPreference" $ErrorActionPreference = "Continue" - & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" + & cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1 2>&1" # links # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun From adb7751b6a88d47b444c6b8265c21a2250b8f3f2 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:34:54 -0500 Subject: [PATCH 56/95] ok so maybe not powershell --- .github/workflows/main.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f53fd5cfea3b..566e127afa38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ on: [push] jobs: test: - name: ${{ matrix.task }} (${{ matrix.os }}) + name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.subtitle }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -12,14 +12,18 @@ jobs: include: - os: ubuntu-latest task: r-package + subtitle: "" - os: macOS-latest task: r-package + subtitle: "" - os: windows-latest task: r-package compiler: MINGW + subtitle: MINGW - os: windows-latest task: r-package compiler: MSVC + subtitle: MSVC - os: ubuntu-latest task: lint steps: @@ -81,14 +85,20 @@ jobs: TASK: "r-package" # https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide # https://stackoverflow.com/a/11826589/3986677 + # run: | + # if ("${{ matrix.compiler }}" -ne "") { + # $env:COMPILER = "${{ matrix.compiler }}" + # } + # $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + # cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" run: | - if ("${{ matrix.compiler }}" -ne "") { - $env:COMPILER = "${{ matrix.compiler }}" - } - $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE - Write-Output "CI default for Errors: $ErrorActionPreference" - $ErrorActionPreference = "Continue" - & cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1 2>&1" + set COMPILER="${{ matrix.compiler }}" + set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% + powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + + +# Write-Output "CI default for Errors: $ErrorActionPreference" +# $ErrorActionPreference = "Continue" # links # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun From fefa2ab8931e3d105fa14d88a10dd7f6a5e44789 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:36:12 -0500 Subject: [PATCH 57/95] cmon now --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 566e127afa38..fe8cb6778048 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,10 +79,9 @@ jobs: run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: pwsh + shell: cmd env: GITHUB_ACTIONS: "true" - TASK: "r-package" # https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide # https://stackoverflow.com/a/11826589/3986677 # run: | @@ -94,6 +93,7 @@ jobs: run: | set COMPILER="${{ matrix.compiler }}" set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% + set TASK="{{ matrix.task }}" powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From b4a2325377087ad276942489352171f604a0db0f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:42:45 -0500 Subject: [PATCH 58/95] ok so --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe8cb6778048..91871155adf0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,7 +93,7 @@ jobs: run: | set COMPILER="${{ matrix.compiler }}" set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% - set TASK="{{ matrix.task }}" + set TASK="${{ matrix.task }}" powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From 0d042898b16c706412aeab2df514d61f3155db95 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 00:49:53 -0500 Subject: [PATCH 59/95] fixing env variables --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91871155adf0..5cc13999ddb0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,7 +81,9 @@ jobs: if: matrix.os == 'windows-latest' shell: cmd env: + COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" + TASK: "${{ matrix.task }}" # https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide # https://stackoverflow.com/a/11826589/3986677 # run: | @@ -91,9 +93,7 @@ jobs: # $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE # cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" run: | - set COMPILER="${{ matrix.compiler }}" set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% - set TASK="${{ matrix.task }}" powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 From 294c32c8b65f4aa47d016f4a41ccc0054144f62a Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 21:18:09 -0500 Subject: [PATCH 60/95] maybe this --- .github/workflows/main.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cc13999ddb0..c6797dd6d4de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,16 +10,16 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - task: r-package - subtitle: "" - - os: macOS-latest - task: r-package - subtitle: "" - - os: windows-latest - task: r-package - compiler: MINGW - subtitle: MINGW + # - os: ubuntu-latest + # task: r-package + # subtitle: "" + # - os: macOS-latest + # task: r-package + # subtitle: "" + # - os: windows-latest + # task: r-package + # compiler: MINGW + # subtitle: MINGW - os: windows-latest task: r-package compiler: MSVC @@ -79,7 +79,7 @@ jobs: run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: cmd + shell: pwsh env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" @@ -93,9 +93,14 @@ jobs: # $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE # cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" run: | - set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% - powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + if ("${{ matrix.compiler }}" -ne "") { + $env:COMPILER = "${{ matrix.compiler }}" + } + $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" +# set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% +# powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 # Write-Output "CI default for Errors: $ErrorActionPreference" # $ErrorActionPreference = "Continue" @@ -107,3 +112,5 @@ jobs: # * https://github.com/marketplace/actions/setup-miniconda # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md +# * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide/2095623#2095623 +# From 8918cb3c5896a87bf083c2f11fa38d584f8f063d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 21:27:12 -0500 Subject: [PATCH 61/95] MINGW job --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6797dd6d4de..61fcfec70155 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,16 +16,16 @@ jobs: # - os: macOS-latest # task: r-package # subtitle: "" - # - os: windows-latest - # task: r-package - # compiler: MINGW - # subtitle: MINGW + - os: windows-latest + task: r-package + compiler: MINGW + subtitle: MINGW - os: windows-latest task: r-package compiler: MSVC subtitle: MSVC - - os: ubuntu-latest - task: lint + # - os: ubuntu-latest + # task: lint steps: - name: Checkout repository uses: actions/checkout@v1 From cf2b7840e44a1716645e7010d79b0e2fd0ed70b2 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 21:38:24 -0500 Subject: [PATCH 62/95] cleaning up --- .github/workflows/main.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61fcfec70155..e6e7f528ce23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,17 +24,25 @@ jobs: task: r-package compiler: MSVC subtitle: MSVC - # - os: ubuntu-latest - # task: lint + - os: ubuntu-latest + task: lint steps: - name: Checkout repository uses: actions/checkout@v1 with: - fetch-depth: 1 + fetch-depth: 5 submodules: true - name: Setup and run tests on Linux and macOS if: matrix.os != 'windows-latest' shell: bash + # export AMDAPPSDK_PATH=$HOME/AMDAPPSDK + # export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" + # export HOME_DIRECTORY="$HOME" + env: + COMPILER: "${{ matrix.compiler }}" + CONDA_ENV: "test-env" + GITHUB_ACTIONS: "true" + TASK: "${{ matrix.task }}" run: | if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then export OS_NAME="macos" @@ -48,23 +56,10 @@ jobs: if [ -z ${{ matrix.compiler }} ]; then export COMPILER=${{ matrix.compiler }} fi - export TASK="${{ matrix.task }}" - export HOME_DIRECTORY="$HOME" export BUILD_DIRECTORY="$GITHUB_WORKSPACE" - if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then - export OS_NAME="macos" - export COMPILER="gcc" - elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - export OS_NAME="linux" - export COMPILER="clang" - fi - export GITHUB_ACTIONS="true" export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:${HOME}/.local/bin:$PATH" - export CONDA_ENV="test-env" export LGB_VER=$(head -n 1 VERSION.txt) - export AMDAPPSDK_PATH=$HOME/AMDAPPSDK - export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh # https://github.com/marketplace/actions/setup-miniconda @@ -93,9 +88,6 @@ jobs: # $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE # cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" run: | - if ("${{ matrix.compiler }}" -ne "") { - $env:COMPILER = "${{ matrix.compiler }}" - } $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" From ff365e01b80b2441faffab184e8f65da3d6bbb0e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 21:48:48 -0500 Subject: [PATCH 63/95] conda init powershell --- .github/workflows/main.yml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6e7f528ce23..7ef095d475b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,9 +10,9 @@ jobs: fail-fast: false matrix: include: - # - os: ubuntu-latest - # task: r-package - # subtitle: "" + - os: ubuntu-latest + task: r-package + subtitle: "" # - os: macOS-latest # task: r-package # subtitle: "" @@ -35,9 +35,6 @@ jobs: - name: Setup and run tests on Linux and macOS if: matrix.os != 'windows-latest' shell: bash - # export AMDAPPSDK_PATH=$HOME/AMDAPPSDK - # export LD_LIBRARY_PATH="$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH" - # export HOME_DIRECTORY="$HOME" env: COMPILER: "${{ matrix.compiler }}" CONDA_ENV: "test-env" @@ -68,10 +65,10 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: auto-update-conda: false - - name: conda init powershell - if: matrix.os == 'windows-latest' - shell: cmd - run: conda init powershell + # - name: conda init powershell + # if: matrix.os == 'windows-latest' + # shell: cmd + # run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: pwsh @@ -79,24 +76,14 @@ jobs: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" TASK: "${{ matrix.task }}" - # https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide - # https://stackoverflow.com/a/11826589/3986677 - # run: | - # if ("${{ matrix.compiler }}" -ne "") { - # $env:COMPILER = "${{ matrix.compiler }}" - # } - # $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE - # cmd /c "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" run: | $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE + conda init powershell & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% # powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 -# Write-Output "CI default for Errors: $ErrorActionPreference" -# $ErrorActionPreference = "Continue" - # links # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners @@ -105,4 +92,4 @@ jobs: # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md # * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide/2095623#2095623 -# +# * https://stackoverflow.com/a/11826589/3986677 From 0454738d75ded0342e3f6ad948a7af208572841b Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:04:08 -0500 Subject: [PATCH 64/95] moving more R stuff into GitHub Actions --- .github/workflows/main.yml | 31 ++++++++++++++++--------------- .travis.yml | 3 --- .vsts-ci.yml | 6 +----- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ef095d475b0..b3312dd709a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,10 +12,20 @@ jobs: include: - os: ubuntu-latest task: r-package - subtitle: "" - # - os: macOS-latest - # task: r-package - # subtitle: "" + compiler: gcc + subtitle: gcc + - os: ubuntu-latest + task: r-package + compiler: clang + subtitle: clang + - os: macOS-latest + task: r-package + compiler: gcc + subtitle: gcc + - os: macOS-latest + task: r-package + compiler: clang + subtitle: clang - os: windows-latest task: r-package compiler: MINGW @@ -43,11 +53,9 @@ jobs: run: | if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then export OS_NAME="macos" - export COMPILER="gcc" export R_MAC_VERSION=3.6.3 elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then export OS_NAME="linux" - export COMPILER="clang" export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; fi if [ -z ${{ matrix.compiler }} ]; then @@ -59,16 +67,11 @@ jobs: export LGB_VER=$(head -n 1 VERSION.txt) $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh - # https://github.com/marketplace/actions/setup-miniconda - name: Use conda on Windows if: matrix.os == 'windows-latest' uses: goanpeca/setup-miniconda@v1 with: auto-update-conda: false - # - name: conda init powershell - # if: matrix.os == 'windows-latest' - # shell: cmd - # run: conda init powershell - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' shell: pwsh @@ -79,10 +82,7 @@ jobs: run: | $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE conda init powershell - & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" - -# set BUILD_SOURCESDIRECTORY=%GITHUB_WORKSPACE% -# powershell.exe -ExecutionPolicy Bypass -File %GITHUB_WORKSPACE%/.ci/test_windows.ps1 + & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1 2&>1" # links # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun @@ -93,3 +93,4 @@ jobs: # * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md # * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide/2095623#2095623 # * https://stackoverflow.com/a/11826589/3986677 +# * https://github.com/marketplace/actions/setup-miniconda diff --git a/.travis.yml b/.travis.yml index a00b250660b5..202e54a148d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ env: - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 - TASK=gpu METHOD=source PYTHON_VERSION=3.5 - TASK=gpu METHOD=pip PYTHON_VERSION=3.6 - - TASK=r-package matrix: exclude: @@ -31,8 +30,6 @@ matrix: env: TASK=gpu METHOD=source PYTHON_VERSION=3.5 - os: osx env: TASK=gpu METHOD=pip PYTHON_VERSION=3.6 - - os: osx - env: TASK=lint - os: osx env: TASK=check-docs diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 906165d89a4d..0ae2ea8dcb2f 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -41,8 +41,6 @@ jobs: TASK: gpu METHOD: source PYTHON_VERSION: 3.6 - r_package: - TASK: r-package steps: - script: | echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" @@ -74,7 +72,7 @@ jobs: pool: vmImage: 'macOS-10.14' strategy: - maxParallel: 4 + maxParallel: 3 matrix: regular: TASK: regular @@ -84,8 +82,6 @@ jobs: PYTHON_VERSION: 3.5 bdist: TASK: bdist - r_package: - TASK: r-package steps: - script: | echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" From e6230fa55400b8096ae9935e209951610f0a7e5d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:14:47 -0500 Subject: [PATCH 65/95] everything else --- .github/workflows/main.yml | 2 +- .travis.yml | 2 -- .vsts-ci.yml | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3312dd709a5..e39ba68a886e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: run: | $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE conda init powershell - & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1 2&>1" + & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" # links # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun diff --git a/.travis.yml b/.travis.yml index 202e54a148d2..eb05a901572e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,11 +40,9 @@ before_install: - if [[ $TRAVIS_OS_NAME == "osx" ]]; then export OS_NAME="macos"; export COMPILER="gcc"; - export R_MAC_VERSION=3.6.3; else export OS_NAME="linux"; export COMPILER="clang"; - export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; fi - export CONDA="$HOME/miniconda" - export PATH="$CONDA/bin:$PATH" diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 0ae2ea8dcb2f..7c4e71d2eb30 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -22,7 +22,7 @@ jobs: vmImage: 'ubuntu-latest' container: ubuntu1404 strategy: - maxParallel: 7 + maxParallel: 6 matrix: regular: TASK: regular @@ -92,7 +92,6 @@ jobs: echo "##vso[task.setvariable variable=CONDA]$CONDA" echo "##vso[task.prependpath]$CONDA/bin" echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" - echo "##vso[task.setvariable variable=R_MAC_VERSION]3.6.3" displayName: 'Set variables' - bash: $(Build.SourcesDirectory)/.ci/setup.sh displayName: Setup From 70e657ec3a068b488bb7a97f330d18017c718689 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:19:23 -0500 Subject: [PATCH 66/95] use powershell --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e39ba68a886e..2de780590be8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: pwsh + shell: powershell env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" @@ -94,3 +94,4 @@ jobs: # * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide/2095623#2095623 # * https://stackoverflow.com/a/11826589/3986677 # * https://github.com/marketplace/actions/setup-miniconda +# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions From 19c7ac52194b7d786063fae7d9b4d907899d5a4c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:30:58 -0500 Subject: [PATCH 67/95] cmon now powershell --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2de780590be8..a94cc1cf762c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,6 +80,7 @@ jobs: GITHUB_ACTIONS: "true" TASK: "${{ matrix.task }}" run: | + $ErrorActionPreference = "Continue" $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE conda init powershell & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" From b5aceda275501c39f495bc62db669ad4d23053dc Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:53:26 -0500 Subject: [PATCH 68/95] ttry to Continue --- .ci/test_r_package_windows.ps1 | 4 ++++ .github/workflows/main.yml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 966cc3dc0e91..a0d1b8ca175d 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -12,6 +12,10 @@ function Download-File-With-Retries { } while(!$?); } +# GitHub Actions puts $ErrorActionPreference = 'stop' on the top of powershell scripts, +# which causes the script to fail if anything is written to stderr +$ErrorActionPreference = "Continue" + $env:R_WINDOWS_VERSION = "3.6.3" $env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' $env:R_LIBS = "$env:R_LIB_PATH" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a94cc1cf762c..6c2fd6dfd888 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,13 +74,12 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: powershell + shell: pwsh env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" TASK: "${{ matrix.task }}" run: | - $ErrorActionPreference = "Continue" $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE conda init powershell & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" @@ -96,3 +95,4 @@ jobs: # * https://stackoverflow.com/a/11826589/3986677 # * https://github.com/marketplace/actions/setup-miniconda # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions +# * see "fail-fast behavior" in https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions From 66c15a171a983caad5853704dc4f587a540dad52 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 22:59:19 -0500 Subject: [PATCH 69/95] override powershell --- .ci/test_r_package_windows.ps1 | 4 ---- .github/workflows/main.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index a0d1b8ca175d..966cc3dc0e91 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -12,10 +12,6 @@ function Download-File-With-Retries { } while(!$?); } -# GitHub Actions puts $ErrorActionPreference = 'stop' on the top of powershell scripts, -# which causes the script to fail if anything is written to stderr -$ErrorActionPreference = "Continue" - $env:R_WINDOWS_VERSION = "3.6.3" $env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' $env:R_LIBS = "$env:R_LIB_PATH" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c2fd6dfd888..07a7be58b8bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: pwsh + shell: pwsh -File {0} env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From cd3f72c8c6b328554f459bc23f9ec471721cdeb0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 23 May 2020 23:33:55 -0500 Subject: [PATCH 70/95] peg MiKTeX URL --- .ci/test_r_package_windows.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 966cc3dc0e91..50a0ba38b099 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -18,6 +18,7 @@ $env:R_LIBS = "$env:R_LIB_PATH" $env:PATH = "$env:R_LIB_PATH/Rtools/bin;" + "$env:R_LIB_PATH/R/bin/x64;" + "$env:R_LIB_PATH/miktex/texmfs/install/miktex/bin/x64;" + $env:PATH $env:CRAN_MIRROR = "https://cloud.r-project.org/" $env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" +$env:MIKTEX_ZIP = "https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-2.9.7442-x64.zip" if ($env:COMPILER -eq "MINGW") { $env:CXX = "$env:R_LIB_PATH/Rtools/mingw_64/bin/g++.exe" @@ -52,7 +53,7 @@ Write-Output "Done installing Rtools" # build the package documentation for those if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" - Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" + Download-File-With-Retries -url "$env:MIKTEX_ZIP" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") Write-Output "Setting up MiKTeX" From 8aa0b125095468bb70588226e3f764e4fce08b19 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 00:05:20 -0500 Subject: [PATCH 71/95] what is happening --- .ci/test_r_package_windows.ps1 | 2 ++ .github/workflows/main.yml | 44 +++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 50a0ba38b099..16ba76ecaefc 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -96,6 +96,8 @@ if ($env:COMPILER -ne "MSVC") { } $note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? + Write-Output "note_str:" + Write-Output $note_str $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07a7be58b8bf..a985a97da671 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,32 +10,32 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - task: r-package - compiler: gcc - subtitle: gcc - - os: ubuntu-latest - task: r-package - compiler: clang - subtitle: clang - - os: macOS-latest - task: r-package - compiler: gcc - subtitle: gcc - - os: macOS-latest - task: r-package - compiler: clang - subtitle: clang + # - os: ubuntu-latest + # task: r-package + # compiler: gcc + # subtitle: gcc + # - os: ubuntu-latest + # task: r-package + # compiler: clang + # subtitle: clang + # - os: macOS-latest + # task: r-package + # compiler: gcc + # subtitle: gcc + # - os: macOS-latest + # task: r-package + # compiler: clang + # subtitle: clang - os: windows-latest task: r-package compiler: MINGW subtitle: MINGW - - os: windows-latest - task: r-package - compiler: MSVC - subtitle: MSVC - - os: ubuntu-latest - task: lint + # - os: windows-latest + # task: r-package + # compiler: MSVC + # subtitle: MSVC + # - os: ubuntu-latest + # task: lint steps: - name: Checkout repository uses: actions/checkout@v1 From 0cf69133d2c06c939886eb6bfe7f9aed62a28721 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 17:32:12 -0500 Subject: [PATCH 72/95] try powershell -File --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a985a97da671..da80eceaf265 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: pwsh -File {0} + shell: powershell -File {0} env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From 68de8ad12efc607ab66d3b34718ab5c1e5ca2e31 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 17:39:50 -0500 Subject: [PATCH 73/95] trying stuff --- .ci/test_r_package_windows.ps1 | 6 ++++++ .github/workflows/main.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 16ba76ecaefc..5cef5dd98f30 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -98,6 +98,12 @@ if ($env:COMPILER -ne "MSVC") { $note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? Write-Output "note_str:" Write-Output $note_str + $stuff = Get-Content "${LOG_FILE_NAME}" + Write-Output "---- stuff ----" + Write-Output $stuff + $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" + Write-Output "---- stuff2 ----" + Write-Output $stuff2 $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da80eceaf265..a985a97da671 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,7 +74,7 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - shell: powershell -File {0} + shell: pwsh -File {0} env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From b85213c1d5358421f01ae2b79791ab1a985142f3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 18:41:47 -0500 Subject: [PATCH 74/95] path --- .ci/test_r_package_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 5cef5dd98f30..72028534b00a 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -95,7 +95,7 @@ if ($env:COMPILER -ne "MSVC") { Check-Output $False } - $note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? + $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? Write-Output "note_str:" Write-Output $note_str $stuff = Get-Content "${LOG_FILE_NAME}" From f6469bf1e855f9aa12a36b1b6fc2135702a66f94 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 19:21:05 -0500 Subject: [PATCH 75/95] more testing of output --- .ci/test_r_package_windows.ps1 | 4 +++- .github/workflows/main.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 72028534b00a..dabe63f356d6 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -101,10 +101,12 @@ if ($env:COMPILER -ne "MSVC") { $stuff = Get-Content "${LOG_FILE_NAME}" Write-Output "---- stuff ----" Write-Output $stuff - $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" + $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String Write-Output "---- stuff2 ----" Write-Output $stuff2 $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' + Write-Output "----- matches -----" + Write-Output $matches $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a985a97da671..cb0efc1610bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,6 +74,8 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' + # have to use 'pwsh' because with 'powershell', anything writing to + # stderr causes the job to fail shell: pwsh -File {0} env: COMPILER: "${{ matrix.compiler }}" From fe9a80c47c825c85fd4ca44ce4a098ecf4825169 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 19:56:07 -0500 Subject: [PATCH 76/95] Matches uppercase --- .ci/test_r_package_windows.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index dabe63f356d6..0afababf525f 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -98,8 +98,8 @@ if ($env:COMPILER -ne "MSVC") { $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? Write-Output "note_str:" Write-Output $note_str - $stuff = Get-Content "${LOG_FILE_NAME}" Write-Output "---- stuff ----" + $stuff = Get-Content "${LOG_FILE_NAME}" Write-Output $stuff $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String Write-Output "---- stuff2 ----" @@ -107,7 +107,10 @@ if ($env:COMPILER -ne "MSVC") { $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' Write-Output "----- matches -----" Write-Output $matches - $NUM_CHECK_NOTES = $matches[1] + Write-Output "----- Matches ----" + Write-Output $Matches + Write-Outpu "-----------" + $NUM_CHECK_NOTES = $Matches[1] $ALLOWED_CHECK_NOTES = 3 if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { Write-Output "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" From 58ad283196bee0e907677c740790765dfad41d31 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 21:21:46 -0500 Subject: [PATCH 77/95] more regex stuff --- .ci/test_r_package_windows.ps1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 0afababf525f..f8b9c07bce2e 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -95,22 +95,24 @@ if ($env:COMPILER -ne "MSVC") { Check-Output $False } - $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? + $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String ; Check-Output $? Write-Output "note_str:" Write-Output $note_str Write-Output "---- stuff ----" $stuff = Get-Content "${LOG_FILE_NAME}" Write-Output $stuff - $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String + $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String Write-Output "---- stuff2 ----" Write-Output $stuff2 - $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' + $relevant_line = $note_str -match '(\d+) NOTE' Write-Output "----- matches -----" Write-Output $matches Write-Output "----- Matches ----" Write-Output $Matches - Write-Outpu "-----------" - $NUM_CHECK_NOTES = $Matches[1] + Write-Output "-----------" + Write-Output "----- relevant_line -----" + Write-Output $relevant_line + $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { Write-Output "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" From 7af8130c6a35824ef5e7a2c66915c341f29e016a Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 21:51:33 -0500 Subject: [PATCH 78/95] this is getting ridiculous --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb0efc1610bd..2d48e4dccffd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,7 @@ jobs: if: matrix.os == 'windows-latest' # have to use 'pwsh' because with 'powershell', anything writing to # stderr causes the job to fail - shell: pwsh -File {0} + shell: pwsh -NonInteractive -ExecutionPolicy Bypass -File {0} env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From 295c7d08b51a66663f0ad2a487802b0e2689e69c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 21:56:52 -0500 Subject: [PATCH 79/95] back to powershell I guess --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d48e4dccffd..3336daffade9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,7 @@ jobs: if: matrix.os == 'windows-latest' # have to use 'pwsh' because with 'powershell', anything writing to # stderr causes the job to fail - shell: pwsh -NonInteractive -ExecutionPolicy Bypass -File {0} + shell: powershell -NonInteractive -ExecutionPolicy Bypass -File {0} env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From 95b2ad580ee9a5b0228c81dd1efd0e1c18abd38e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 22:04:13 -0500 Subject: [PATCH 80/95] more commands --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3336daffade9..a6534a0d9002 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,7 @@ jobs: if: matrix.os == 'windows-latest' # have to use 'pwsh' because with 'powershell', anything writing to # stderr causes the job to fail - shell: powershell -NonInteractive -ExecutionPolicy Bypass -File {0} + shell: pwsh -NonInteractive -ExecutionPolicy Bypass -Command "& '{0}'" env: COMPILER: "${{ matrix.compiler }}" GITHUB_ACTIONS: "true" From f6fc655cc22addec2ba8a077f8f560a7882414ab Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 22:25:10 -0500 Subject: [PATCH 81/95] this might work --- .ci/test_r_package_windows.ps1 | 18 +----------- .github/workflows/main.yml | 50 +++++++++++++++++----------------- 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index f8b9c07bce2e..371eda68210d 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -18,7 +18,6 @@ $env:R_LIBS = "$env:R_LIB_PATH" $env:PATH = "$env:R_LIB_PATH/Rtools/bin;" + "$env:R_LIB_PATH/R/bin/x64;" + "$env:R_LIB_PATH/miktex/texmfs/install/miktex/bin/x64;" + $env:PATH $env:CRAN_MIRROR = "https://cloud.r-project.org/" $env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" -$env:MIKTEX_ZIP = "https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-2.9.7442-x64.zip" if ($env:COMPILER -eq "MINGW") { $env:CXX = "$env:R_LIB_PATH/Rtools/mingw_64/bin/g++.exe" @@ -53,7 +52,7 @@ Write-Output "Done installing Rtools" # build the package documentation for those if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" - Download-File-With-Retries -url "$env:MIKTEX_ZIP" -destfile "miktexsetup-x64.zip" + Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") Write-Output "Setting up MiKTeX" @@ -96,22 +95,7 @@ if ($env:COMPILER -ne "MSVC") { } $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String ; Check-Output $? - Write-Output "note_str:" - Write-Output $note_str - Write-Output "---- stuff ----" - $stuff = Get-Content "${LOG_FILE_NAME}" - Write-Output $stuff - $stuff2 = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String - Write-Output "---- stuff2 ----" - Write-Output $stuff2 $relevant_line = $note_str -match '(\d+) NOTE' - Write-Output "----- matches -----" - Write-Output $matches - Write-Output "----- Matches ----" - Write-Output $Matches - Write-Output "-----------" - Write-Output "----- relevant_line -----" - Write-Output $relevant_line $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6534a0d9002..55e9501a6a31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,32 +10,32 @@ jobs: fail-fast: false matrix: include: - # - os: ubuntu-latest - # task: r-package - # compiler: gcc - # subtitle: gcc - # - os: ubuntu-latest - # task: r-package - # compiler: clang - # subtitle: clang - # - os: macOS-latest - # task: r-package - # compiler: gcc - # subtitle: gcc - # - os: macOS-latest - # task: r-package - # compiler: clang - # subtitle: clang + - os: ubuntu-latest + task: r-package + compiler: gcc + subtitle: gcc + - os: ubuntu-latest + task: r-package + compiler: clang + subtitle: clang + - os: macOS-latest + task: r-package + compiler: gcc + subtitle: gcc + - os: macOS-latest + task: r-package + compiler: clang + subtitle: clang - os: windows-latest task: r-package compiler: MINGW subtitle: MINGW - # - os: windows-latest - # task: r-package - # compiler: MSVC - # subtitle: MSVC - # - os: ubuntu-latest - # task: lint + - os: windows-latest + task: r-package + compiler: MSVC + subtitle: MSVC + - os: ubuntu-latest + task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -74,8 +74,8 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - # have to use 'pwsh' because with 'powershell', anything writing to - # stderr causes the job to fail + # have to use this explicit command to override the GitHub Actions + # default, where any command writing to stderr causes build failures shell: pwsh -NonInteractive -ExecutionPolicy Bypass -Command "& '{0}'" env: COMPILER: "${{ matrix.compiler }}" @@ -86,7 +86,7 @@ jobs: conda init powershell & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" -# links +# references # * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun # * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners # * https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable From 3ebeccd72d3f9f03cb650bf1e33a0ed4c19b5eb6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 23:14:08 -0500 Subject: [PATCH 82/95] adding more reliable miktex download --- .ci/download-miktex.R | 25 +++++++++++++++++++++++++ .ci/test_r_package_windows.ps1 | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .ci/download-miktex.R diff --git a/.ci/download-miktex.R b/.ci/download-miktex.R new file mode 100644 index 000000000000..89ce4f1fc5fa --- /dev/null +++ b/.ci/download-miktex.R @@ -0,0 +1,25 @@ +# mirrors that host miktexsetup.zip do so only with explicitly-named +# files like miktexsetup-2.4.5.zip, so hard-coding a link to an archive as a +# way to peg to one mirror does not work +# +# this script will find the specific version of miktexsetup.zip at a given +# mirror +library(httr) +args <- commandArgs(trailingOnly = TRUE) +DESTFILE <- args[[1L]] +MIRROR <- "https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/" +mirror_contents <- httr::content( + httr::RETRY("GET", mirror) + , as = "text" +) +content_lines <- strsplit(mirror_contents, "\n")[[1L]] +content_lines <- content_lines[grepl("miktexsetup-.*", content_lines)] +zip_loc <- regexpr(">miktexsetup-[0-9]+.*x64\\.zip", content_lines) +zip_name <- gsub(">", "", regmatches(content_lines, zip_loc)) +full_zip_url <- file.path(MIRROR, zip_name) +print(sprintf("downloading %s", full_zip_url)) +download.file( + url = full_zip_url + , destfile = DESTFILE +) +print(sprintf("MiKTeX setup downloaded to %s", DESTFILE)) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 371eda68210d..ff1bf0b74696 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -52,7 +52,8 @@ Write-Output "Done installing Rtools" # build the package documentation for those if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" - Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" + Rscript $env:BUILD_SOURCESDIRECTORY\.ci\download-miktex.R "miktexsetup-x64.zip" + #Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") Write-Output "Setting up MiKTeX" From 9b238232493d0135a6ce719024c7555ab625d3cc Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 23:18:32 -0500 Subject: [PATCH 83/95] trying to download miktex --- .ci/test_r_package_windows.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index ff1bf0b74696..7d4e2e7b44d9 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -48,6 +48,10 @@ Write-Output "Installing Rtools" Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/Rtools" ; Check-Output $? Write-Output "Done installing Rtools" +Write-Output "Installing dependencies" +$packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? + # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those if ($env:COMPILER -eq "MINGW") { @@ -66,10 +70,6 @@ if ($env:COMPILER -eq "MINGW") { conda install -q -y --no-deps pandoc } -Write-Output "Installing dependencies" -$packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? - Write-Output "Building R package" # R CMD check is not used for MSVC builds From 007775622aa1da379705eb8b3bbfded987b18aa2 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 23:33:37 -0500 Subject: [PATCH 84/95] installing httr --- .ci/test_r_package_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 7d4e2e7b44d9..7b53be1e4bbd 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -49,7 +49,7 @@ Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT Write-Output "Done installing Rtools" Write-Output "Installing dependencies" -$packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" +$packages = "c('data.table', 'jsonlite', 'httr', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't From ba94d944e8ae173e22da3441b5f298227c5b8ff1 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 23:37:01 -0500 Subject: [PATCH 85/95] fix error in MiKTeX script --- .ci/download-miktex.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/download-miktex.R b/.ci/download-miktex.R index 89ce4f1fc5fa..f0d4b98cac5a 100644 --- a/.ci/download-miktex.R +++ b/.ci/download-miktex.R @@ -9,7 +9,7 @@ args <- commandArgs(trailingOnly = TRUE) DESTFILE <- args[[1L]] MIRROR <- "https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/" mirror_contents <- httr::content( - httr::RETRY("GET", mirror) + httr::RETRY("GET", MIRROR) , as = "text" ) content_lines <- strsplit(mirror_contents, "\n")[[1L]] From 19179a9984a03f2a9433e8f3dba3078ed2ee9e53 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 May 2020 23:57:32 -0500 Subject: [PATCH 86/95] remove comments --- .ci/test_r_package_windows.ps1 | 1 - .github/workflows/main.yml | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 7b53be1e4bbd..73712d5d8c9a 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -57,7 +57,6 @@ Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.pac if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" Rscript $env:BUILD_SOURCESDIRECTORY\.ci\download-miktex.R "miktexsetup-x64.zip" - #Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") Write-Output "Setting up MiKTeX" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55e9501a6a31..f653753a7e54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,16 +85,3 @@ jobs: $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE conda init powershell & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" - -# references -# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun -# * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -# * https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable -# * https://github.com/marketplace/actions/setup-miniconda -# * https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources -# * https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md -# * https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide/2095623#2095623 -# * https://stackoverflow.com/a/11826589/3986677 -# * https://github.com/marketplace/actions/setup-miniconda -# * https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# * see "fail-fast behavior" in https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions From c2c6a3950c75d091bec632a109cacefd3ab640a5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 25 May 2020 23:18:15 -0500 Subject: [PATCH 87/95] redirect output --- .ci/test_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index fd0e9f95a5e4..fd246cbc0695 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -13,7 +13,7 @@ if (Test-Path env:APPVEYOR) { } if ($env:TASK -eq "r-package") { - & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? + & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 | Out-String -Stream ; Check-Output $? Exit 0 } From 75fc7c182c3e487ce41adc2e8e0f454c8cd7225f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 25 May 2020 23:18:15 -0500 Subject: [PATCH 88/95] redirect output --- .ci/test_r_package_windows.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 73712d5d8c9a..604fb508b29a 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -50,7 +50,7 @@ Write-Output "Done installing Rtools" Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'httr', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" | Out-String -Stream ; Check-Output $? # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those @@ -65,7 +65,7 @@ if ($env:COMPILER -eq "MINGW") { .\miktex\download\miktexsetup.exe --remote-package-repository="$env:CTAN_MIRROR" --portable="$env:R_LIB_PATH/miktex" --quiet install ; Check-Output $? Write-Output "Done installing MiKTeX" - initexmf --set-config-value [MPM]AutoInstall=1 + initexmf --set-config-value [MPM]AutoInstall=1 | Out-String -Stream conda install -q -y --no-deps pandoc } @@ -80,7 +80,7 @@ if ($env:COMPILER -ne "MSVC") { $env:_R_CHECK_FORCE_SUGGESTS_ = 0 Write-Output "Running R CMD check as CRAN" - R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} ; $check_succeeded = $? + R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} | Out-String -Stream ; $check_succeeded = $? Write-Output "R CMD check build logs:" $INSTALL_LOG_FILE_NAME = "$env:BUILD_SOURCESDIRECTORY\lightgbm.Rcheck\00install.out" From 4278d61378551e08fdf7be8bbba71c2ae1ff897e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 25 May 2020 23:40:12 -0500 Subject: [PATCH 89/95] move linting back to Travis --- .github/workflows/main.yml | 12 +----------- .travis.yml | 1 + 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f653753a7e54..d59f83afe5f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ on: [push] jobs: test: - name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.subtitle }}) + name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -13,29 +13,21 @@ jobs: - os: ubuntu-latest task: r-package compiler: gcc - subtitle: gcc - os: ubuntu-latest task: r-package compiler: clang - subtitle: clang - os: macOS-latest task: r-package compiler: gcc - subtitle: gcc - os: macOS-latest task: r-package compiler: clang - subtitle: clang - os: windows-latest task: r-package compiler: MINGW - subtitle: MINGW - os: windows-latest task: r-package compiler: MSVC - subtitle: MSVC - - os: ubuntu-latest - task: lint steps: - name: Checkout repository uses: actions/checkout@v1 @@ -74,8 +66,6 @@ jobs: auto-update-conda: false - name: Setup and run tests on Windows if: matrix.os == 'windows-latest' - # have to use this explicit command to override the GitHub Actions - # default, where any command writing to stderr causes build failures shell: pwsh -NonInteractive -ExecutionPolicy Bypass -Command "& '{0}'" env: COMPILER: "${{ matrix.compiler }}" diff --git a/.travis.yml b/.travis.yml index eb05a901572e..cc14438e07a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ env: - TASK=sdist PYTHON_VERSION=2.7 - TASK=bdist - TASK=if-else + - TASK=lint - TASK=check-docs - TASK=mpi METHOD=source - TASK=mpi METHOD=pip PYTHON_VERSION=3.7 From 2e8d8a8380af086fb53fb5ff819482c121625f43 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 25 May 2020 23:46:34 -0500 Subject: [PATCH 90/95] change redirection --- .ci/test_r_package_windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 604fb508b29a..0e91a9b8612e 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -50,7 +50,7 @@ Write-Output "Done installing Rtools" Write-Output "Installing dependencies" $packages = "c('data.table', 'jsonlite', 'httr', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" | Out-String -Stream ; Check-Output $? +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" | Out-String -Stream # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those @@ -80,7 +80,7 @@ if ($env:COMPILER -ne "MSVC") { $env:_R_CHECK_FORCE_SUGGESTS_ = 0 Write-Output "Running R CMD check as CRAN" - R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} | Out-String -Stream ; $check_succeeded = $? + R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} ; $check_succeeded = $? Write-Output "R CMD check build logs:" $INSTALL_LOG_FILE_NAME = "$env:BUILD_SOURCESDIRECTORY\lightgbm.Rcheck\00install.out" From 6efe52ff45590def0a02911f480ea0424a746847 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 27 May 2020 20:13:18 -0500 Subject: [PATCH 91/95] switch back to just mac and linux --- .appveyor.yml | 5 +++++ .ci/download-miktex.R | 25 ------------------------- .ci/test_r_package_windows.ps1 | 16 ++++++++-------- .ci/test_windows.ps1 | 2 +- .github/workflows/main.yml | 22 ---------------------- 5 files changed, 14 insertions(+), 56 deletions(-) delete mode 100644 .ci/download-miktex.R diff --git a/.appveyor.yml b/.appveyor.yml index f3404faa68b9..f27fa78fb89c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,6 +13,11 @@ branches: environment: matrix: + - COMPILER: MINGW + TASK: r-package + - COMPILER: MSVC + TASK: r-package + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - COMPILER: MSVC TASK: python - COMPILER: MINGW diff --git a/.ci/download-miktex.R b/.ci/download-miktex.R deleted file mode 100644 index f0d4b98cac5a..000000000000 --- a/.ci/download-miktex.R +++ /dev/null @@ -1,25 +0,0 @@ -# mirrors that host miktexsetup.zip do so only with explicitly-named -# files like miktexsetup-2.4.5.zip, so hard-coding a link to an archive as a -# way to peg to one mirror does not work -# -# this script will find the specific version of miktexsetup.zip at a given -# mirror -library(httr) -args <- commandArgs(trailingOnly = TRUE) -DESTFILE <- args[[1L]] -MIRROR <- "https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/" -mirror_contents <- httr::content( - httr::RETRY("GET", MIRROR) - , as = "text" -) -content_lines <- strsplit(mirror_contents, "\n")[[1L]] -content_lines <- content_lines[grepl("miktexsetup-.*", content_lines)] -zip_loc <- regexpr(">miktexsetup-[0-9]+.*x64\\.zip", content_lines) -zip_name <- gsub(">", "", regmatches(content_lines, zip_loc)) -full_zip_url <- file.path(MIRROR, zip_name) -print(sprintf("downloading %s", full_zip_url)) -download.file( - url = full_zip_url - , destfile = DESTFILE -) -print(sprintf("MiKTeX setup downloaded to %s", DESTFILE)) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 0e91a9b8612e..966cc3dc0e91 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -48,15 +48,11 @@ Write-Output "Installing Rtools" Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/Rtools" ; Check-Output $? Write-Output "Done installing Rtools" -Write-Output "Installing dependencies" -$packages = "c('data.table', 'jsonlite', 'httr', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" | Out-String -Stream - # MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't # build the package documentation for those if ($env:COMPILER -eq "MINGW") { Write-Output "Downloading MiKTeX" - Rscript $env:BUILD_SOURCESDIRECTORY\.ci\download-miktex.R "miktexsetup-x64.zip" + Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") Write-Output "Setting up MiKTeX" @@ -65,10 +61,14 @@ if ($env:COMPILER -eq "MINGW") { .\miktex\download\miktexsetup.exe --remote-package-repository="$env:CTAN_MIRROR" --portable="$env:R_LIB_PATH/miktex" --quiet install ; Check-Output $? Write-Output "Done installing MiKTeX" - initexmf --set-config-value [MPM]AutoInstall=1 | Out-String -Stream + initexmf --set-config-value [MPM]AutoInstall=1 conda install -q -y --no-deps pandoc } +Write-Output "Installing dependencies" +$packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" +Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? + Write-Output "Building R package" # R CMD check is not used for MSVC builds @@ -94,8 +94,8 @@ if ($env:COMPILER -ne "MSVC") { Check-Output $False } - $note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String ; Check-Output $? - $relevant_line = $note_str -match '(\d+) NOTE' + $note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? + $relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' $NUM_CHECK_NOTES = $matches[1] $ALLOWED_CHECK_NOTES = 3 if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index fd246cbc0695..fd0e9f95a5e4 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -13,7 +13,7 @@ if (Test-Path env:APPVEYOR) { } if ($env:TASK -eq "r-package") { - & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 | Out-String -Stream ; Check-Output $? + & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? Exit 0 } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d59f83afe5f9..7310091c268f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,12 +22,6 @@ jobs: - os: macOS-latest task: r-package compiler: clang - - os: windows-latest - task: r-package - compiler: MINGW - - os: windows-latest - task: r-package - compiler: MSVC steps: - name: Checkout repository uses: actions/checkout@v1 @@ -59,19 +53,3 @@ jobs: export LGB_VER=$(head -n 1 VERSION.txt) $GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/test.sh - - name: Use conda on Windows - if: matrix.os == 'windows-latest' - uses: goanpeca/setup-miniconda@v1 - with: - auto-update-conda: false - - name: Setup and run tests on Windows - if: matrix.os == 'windows-latest' - shell: pwsh -NonInteractive -ExecutionPolicy Bypass -Command "& '{0}'" - env: - COMPILER: "${{ matrix.compiler }}" - GITHUB_ACTIONS: "true" - TASK: "${{ matrix.task }}" - run: | - $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE - conda init powershell - & "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" From f06fd220c47c5f8762be6c4139266cf919d4e236 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 27 May 2020 20:39:37 -0500 Subject: [PATCH 92/95] put linting exclude back --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc14438e07a3..c1604000e98d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,8 @@ matrix: env: TASK=gpu METHOD=source PYTHON_VERSION=3.5 - os: osx env: TASK=gpu METHOD=pip PYTHON_VERSION=3.6 + - os: osx + env: TASK=lint - os: osx env: TASK=check-docs From 1ea7a360df0114dc4f8b63b82613731f95f49a47 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 29 May 2020 20:27:01 -0500 Subject: [PATCH 93/95] renamed R_TRAVIS_LINUX --- .ci/test_r_package.sh | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index d9377857a518..5fb35bb887b1 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -23,7 +23,7 @@ if [[ $AZURE != "true" ]] && [[ $OS_NAME == "linux" ]]; then sudo apt-get install \ --no-install-recommends \ -y \ - r-base-dev=${R_TRAVIS_LINUX_VERSION} \ + r-base-dev=${R_LINUX_VERSION} \ texinfo \ texlive-latex-recommended \ texlive-fonts-recommended \ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7310091c268f..2c770994b0bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: export R_MAC_VERSION=3.6.3 elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then export OS_NAME="linux" - export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic; + export R_LINUX_VERSION=3.6.3-1bionic; fi if [ -z ${{ matrix.compiler }} ]; then export COMPILER=${{ matrix.compiler }} From 728d7f0cb8b2470143ab66a27fed1d94ae78d353 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 29 May 2020 20:41:56 -0500 Subject: [PATCH 94/95] revert changes to non-R tasks and update events --- .ci/test.sh | 4 ++-- .github/workflows/main.yml | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index b64cc510a505..7c68ca733fe9 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -13,7 +13,7 @@ source activate $CONDA_ENV cd $BUILD_DIRECTORY -if [[ $TASK == "check-docs" ]]; then +if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then cd $BUILD_DIRECTORY/docs conda install -q -y -n $CONDA_ENV -c conda-forge doxygen pip install --user -r requirements.txt rstcheck @@ -40,7 +40,7 @@ if [[ $TASK == "check-docs" ]]; then exit 0 fi -if [[ $TASK == "lint" ]]; then +if [[ $TRAVIS == "true" ]] && [[ $TASK == "lint" ]]; then conda install -q -y -n $CONDA_ENV \ pycodestyle \ pydocstyle \ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c770994b0bf..9955dd73217e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,12 @@ name: GitHub Actions -on: [push] +on: + push: + branches: + - master + pull_request: + branches: + - master jobs: test: From 0710aae4d7f86375978ae023df1bd3a7664bff3e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 31 May 2020 11:59:13 -0500 Subject: [PATCH 95/95] simplify --- .github/workflows/main.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9955dd73217e..eefebe2a9cb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,12 +37,10 @@ jobs: - name: Setup and run tests on Linux and macOS if: matrix.os != 'windows-latest' shell: bash - env: - COMPILER: "${{ matrix.compiler }}" - CONDA_ENV: "test-env" - GITHUB_ACTIONS: "true" - TASK: "${{ matrix.task }}" run: | + export TASK="${{ matrix.task }}" + export COMPILER="${{ matrix.compiler }}" + export GITHUB_ACTIONS="true" if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then export OS_NAME="macos" export R_MAC_VERSION=3.6.3 @@ -50,10 +48,8 @@ jobs: export OS_NAME="linux" export R_LINUX_VERSION=3.6.3-1bionic; fi - if [ -z ${{ matrix.compiler }} ]; then - export COMPILER=${{ matrix.compiler }} - fi export BUILD_DIRECTORY="$GITHUB_WORKSPACE" + export CONDA_ENV="test-env" export CONDA="$HOME/miniconda" export PATH="$CONDA/bin:${HOME}/.local/bin:$PATH" export LGB_VER=$(head -n 1 VERSION.txt)