"git@developer.sourcefind.cn:jerrrrry/infinicore.git" did not exist on "da0cef143c7f7102a42a9752014a8539f2108683"
Unverified Commit bcbf2527 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] use GitHub Actions for R CI jobs (fixes #2353) (#3119)

* GitHub Actions

* ok

* fixing on list

* stuff

* directories

* directories

* things

* env variables

* working dir

* running a bunch of tasks

* more builds

* PATH

* actually use R task

* TASK

* be right, often

* doing stuff

* trying stuff

* more paths

* conda activate

* updating PATH

* trying bash

* where the hell is activate

* WHERE IS ACTIVATE

* set up conda

* more conda

* PLEASE WORK

* installing cpplint

* try r-package

* R version

* try windows job

* make windows work

* use powershell

* exe

* use conda

* conda init powershell

* different conda approach

* make it work

* cleaning up

* init powershell

* fixing windows

* more windows

* build directory

* no way right

* maybe it will work

* trying Visual Studio

* do this

* Windows is interesting

* put back check-output

* set compiler

* stuff

* more fixes

* fix the broken things

* updating jobs

* continuing

* poweshell is bad

* ok so maybe not powershell

* cmon now

* ok so

* fixing env variables

* maybe this

* MINGW job

* cleaning up

* conda init powershell

* moving more R stuff into GitHub Actions

* everything else

* use powershell

* cmon now powershell

* ttry to Continue

* override powershell

* peg MiKTeX URL

* what is happening

* try powershell -File

* trying stuff

* path

* more testing of output

* Matches uppercase

* more regex stuff

* this is getting ridiculous

* back to powershell I guess

* more commands

* this might work

* adding more reliable miktex download

* trying to download miktex

* installing httr

* fix error in MiKTeX script

* remove comments

* redirect output

* redirect output

* move linting back to Travis

* change redirection

* switch back to just mac and linux

* put linting exclude back

* renamed R_TRAVIS_LINUX

* revert changes to non-R tasks and update events

* simplify
parent 656d2676
...@@ -36,12 +36,12 @@ else # Linux ...@@ -36,12 +36,12 @@ else # Linux
mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/ mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/
echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
fi fi
if [[ $TRAVIS == "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 wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi fi
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 sh conda.sh -b -p $CONDA
fi fi
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
......
...@@ -13,7 +13,7 @@ export PATH="$R_LIB_PATH/R/bin:$PATH" ...@@ -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 # 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 # 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 \ sudo apt-key adv \
--keyserver keyserver.ubuntu.com \ --keyserver keyserver.ubuntu.com \
--recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
...@@ -23,7 +23,7 @@ if [[ $TRAVIS == "true" ]] && [[ $OS_NAME == "linux" ]]; then ...@@ -23,7 +23,7 @@ if [[ $TRAVIS == "true" ]] && [[ $OS_NAME == "linux" ]]; then
sudo apt-get install \ sudo apt-get install \
--no-install-recommends \ --no-install-recommends \
-y \ -y \
r-base-dev=${R_TRAVIS_LINUX_VERSION} \ r-base-dev=${R_LINUX_VERSION} \
texinfo \ texinfo \
texlive-latex-recommended \ texlive-latex-recommended \
texlive-fonts-recommended \ texlive-fonts-recommended \
......
name: GitHub Actions
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
task: r-package
compiler: gcc
- os: ubuntu-latest
task: r-package
compiler: clang
- os: macOS-latest
task: r-package
compiler: gcc
- os: macOS-latest
task: r-package
compiler: clang
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 5
submodules: true
- name: Setup and run tests on Linux and macOS
if: matrix.os != 'windows-latest'
shell: bash
run: |
export TASK="${{ matrix.task }}"
export COMPILER="${{ matrix.compiler }}"
export GITHUB_ACTIONS="true"
if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then
export OS_NAME="macos"
export R_MAC_VERSION=3.6.3
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export OS_NAME="linux"
export R_LINUX_VERSION=3.6.3-1bionic;
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)
$GITHUB_WORKSPACE/.ci/setup.sh
$GITHUB_WORKSPACE/.ci/test.sh
...@@ -24,7 +24,6 @@ env: ...@@ -24,7 +24,6 @@ env:
- TASK=mpi METHOD=pip PYTHON_VERSION=3.7 - TASK=mpi METHOD=pip PYTHON_VERSION=3.7
- TASK=gpu METHOD=source PYTHON_VERSION=3.5 - TASK=gpu METHOD=source PYTHON_VERSION=3.5
- TASK=gpu METHOD=pip PYTHON_VERSION=3.6 - TASK=gpu METHOD=pip PYTHON_VERSION=3.6
- TASK=r-package
matrix: matrix:
exclude: exclude:
...@@ -44,11 +43,9 @@ before_install: ...@@ -44,11 +43,9 @@ before_install:
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then - if [[ $TRAVIS_OS_NAME == "osx" ]]; then
export OS_NAME="macos"; export OS_NAME="macos";
export COMPILER="gcc"; export COMPILER="gcc";
export R_MAC_VERSION=3.6.3;
else else
export OS_NAME="linux"; export OS_NAME="linux";
export COMPILER="clang"; export COMPILER="clang";
export R_TRAVIS_LINUX_VERSION=3.6.3-1bionic;
fi fi
- export CONDA="$HOME/miniconda" - export CONDA="$HOME/miniconda"
- export PATH="$CONDA/bin:$PATH" - export PATH="$CONDA/bin:$PATH"
......
...@@ -22,7 +22,7 @@ jobs: ...@@ -22,7 +22,7 @@ jobs:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
container: ubuntu1404 container: ubuntu1404
strategy: strategy:
maxParallel: 7 maxParallel: 6
matrix: matrix:
regular: regular:
TASK: regular TASK: regular
...@@ -41,8 +41,6 @@ jobs: ...@@ -41,8 +41,6 @@ jobs:
TASK: gpu TASK: gpu
METHOD: source METHOD: source
PYTHON_VERSION: 3.6 PYTHON_VERSION: 3.6
r_package:
TASK: r-package
steps: steps:
- script: | - script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
...@@ -74,7 +72,7 @@ jobs: ...@@ -74,7 +72,7 @@ jobs:
pool: pool:
vmImage: 'macOS-10.14' vmImage: 'macOS-10.14'
strategy: strategy:
maxParallel: 4 maxParallel: 3
matrix: matrix:
regular: regular:
TASK: regular TASK: regular
...@@ -84,8 +82,6 @@ jobs: ...@@ -84,8 +82,6 @@ jobs:
PYTHON_VERSION: 3.5 PYTHON_VERSION: 3.5
bdist: bdist:
TASK: bdist TASK: bdist
r_package:
TASK: r-package
steps: steps:
- script: | - script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
...@@ -96,7 +92,6 @@ jobs: ...@@ -96,7 +92,6 @@ jobs:
echo "##vso[task.setvariable variable=CONDA]$CONDA" echo "##vso[task.setvariable variable=CONDA]$CONDA"
echo "##vso[task.prependpath]$CONDA/bin" echo "##vso[task.prependpath]$CONDA/bin"
echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64" 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' displayName: 'Set variables'
- bash: $(Build.SourcesDirectory)/.ci/setup.sh - bash: $(Build.SourcesDirectory)/.ci/setup.sh
displayName: Setup displayName: Setup
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment