Skip to content

Commit

Permalink
[ci] use GitHub Actions for R CI jobs (fixes microsoft#2353) (microso…
Browse files Browse the repository at this point in the history
…ft#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
  • Loading branch information
jameslamb authored and ChipKerchner committed Jun 10, 2020
1 parent 3d7fa7a commit 0070bab
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ 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_ACTIONS == "true" ]]; then
wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
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
Expand Down
4 changes: 2 additions & 2 deletions .ci/test_r_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,7 +23,7 @@ if [[ $TRAVIS == "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 \
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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:
Expand All @@ -44,11 +43,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"
Expand Down
9 changes: 2 additions & 7 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
vmImage: 'ubuntu-latest'
container: ubuntu1404
strategy:
maxParallel: 7
maxParallel: 6
matrix:
regular:
TASK: regular
Expand All @@ -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"
Expand Down Expand Up @@ -74,7 +72,7 @@ jobs:
pool:
vmImage: 'macOS-10.14'
strategy:
maxParallel: 4
maxParallel: 3
matrix:
regular:
TASK: regular
Expand All @@ -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"
Expand All @@ -96,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
Expand Down

0 comments on commit 0070bab

Please sign in to comment.