Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing GitHub actions #29

Closed
wants to merge 105 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
97c4720
GitHub Actions
jameslamb May 22, 2020
f84965a
ok
jameslamb May 22, 2020
d9ea1be
fixing on list
jameslamb May 22, 2020
fbca025
stuff
jameslamb May 22, 2020
ec6dfdb
directories
jameslamb May 22, 2020
45a44aa
directories
jameslamb May 22, 2020
7132aef
things
jameslamb May 22, 2020
4cc2fbb
env variables
jameslamb May 22, 2020
77ddfcb
working dir
jameslamb May 22, 2020
c36871e
running a bunch of tasks
jameslamb May 22, 2020
961c7d7
more builds
jameslamb May 22, 2020
1a6d128
PATH
jameslamb May 22, 2020
6c72e48
actually use R task
jameslamb May 22, 2020
6fdeffa
TASK
jameslamb May 22, 2020
0d6844b
be right, often
jameslamb May 22, 2020
07ba035
doing stuff
jameslamb May 22, 2020
62db734
trying stuff
jameslamb May 22, 2020
4af638c
more paths
jameslamb May 22, 2020
2be6044
conda activate
jameslamb May 22, 2020
2688509
updating PATH
jameslamb May 22, 2020
96badbd
trying bash
jameslamb May 22, 2020
81f50e1
where the hell is activate
jameslamb May 22, 2020
7754d01
WHERE IS ACTIVATE
jameslamb May 22, 2020
f3a11f1
set up conda
jameslamb May 22, 2020
0b896bf
more conda
jameslamb May 22, 2020
4a60c9d
PLEASE WORK
jameslamb May 22, 2020
f60d356
installing cpplint
jameslamb May 22, 2020
4b55665
try r-package
jameslamb May 22, 2020
5c97456
R version
jameslamb May 22, 2020
f0408c0
try windows job
jameslamb May 22, 2020
bd30d4b
make windows work
jameslamb May 22, 2020
4d96541
use powershell
jameslamb May 22, 2020
def0258
exe
jameslamb May 22, 2020
7790c0e
use conda
jameslamb May 22, 2020
08a75b8
conda init powershell
jameslamb May 22, 2020
a21c56c
different conda approach
jameslamb May 22, 2020
54b32de
make it work
jameslamb May 22, 2020
7d51c4f
cleaning up
jameslamb May 22, 2020
684f7f1
init powershell
jameslamb May 22, 2020
c4db9cf
fixing windows
jameslamb May 23, 2020
1055b13
more windows
jameslamb May 23, 2020
2f73f3c
build directory
jameslamb May 23, 2020
ef522ce
no way right
jameslamb May 23, 2020
f26b7d6
maybe it will work
jameslamb May 23, 2020
90ae343
trying Visual Studio
jameslamb May 23, 2020
3fba5d9
do this
jameslamb May 23, 2020
ee32623
Windows is interesting
jameslamb May 23, 2020
09b87d9
put back check-output
jameslamb May 23, 2020
b9978ca
set compiler
jameslamb May 23, 2020
edbe16f
stuff
jameslamb May 23, 2020
bdc365f
more fixes
jameslamb May 23, 2020
f07d799
fix the broken things
jameslamb May 23, 2020
fb2cc48
updating jobs
jameslamb May 23, 2020
dcc1b12
continuing
jameslamb May 23, 2020
732c1c8
poweshell is bad
jameslamb May 23, 2020
99d90f5
ok so maybe not powershell
jameslamb May 23, 2020
d54ac80
cmon now
jameslamb May 23, 2020
fd15a18
ok so
jameslamb May 23, 2020
f897711
fixing env variables
jameslamb May 23, 2020
0ca9571
maybe this
jameslamb May 24, 2020
f121e8f
MINGW job
jameslamb May 24, 2020
3106c58
cleaning up
jameslamb May 24, 2020
98f837f
conda init powershell
jameslamb May 24, 2020
40a6b84
moving more R stuff into GitHub Actions
jameslamb May 24, 2020
7f35639
everything else
jameslamb May 24, 2020
ee94504
use powershell
jameslamb May 24, 2020
b91a141
cmon now powershell
jameslamb May 24, 2020
0ead971
ttry to Continue
jameslamb May 24, 2020
5fb260a
override powershell
jameslamb May 24, 2020
247fa75
peg MiKTeX URL
jameslamb May 24, 2020
0feff03
what is happening
jameslamb May 24, 2020
a002a10
try powershell -File
jameslamb May 24, 2020
cd751f3
trying stuff
jameslamb May 24, 2020
b5759a1
path
jameslamb May 24, 2020
3ea1c4b
more testing of output
jameslamb May 25, 2020
b99e535
Matches uppercase
jameslamb May 25, 2020
578a160
more regex stuff
jameslamb May 25, 2020
963de65
empty commit
jameslamb May 25, 2020
b0c02e6
this is getting ridiculous
jameslamb May 25, 2020
bfe0f30
back to powershell I guess
jameslamb May 25, 2020
7b5057c
more commands
jameslamb May 25, 2020
861f82d
this might work
jameslamb May 25, 2020
99566ba
empty commit
jameslamb May 25, 2020
f879a9f
adding more reliable miktex download
jameslamb May 25, 2020
54e986a
trying to download miktex
jameslamb May 25, 2020
b55d756
empty commit
jameslamb May 25, 2020
759f0f0
installing httr
jameslamb May 25, 2020
e9e0e00
fix error in MiKTeX script
jameslamb May 25, 2020
0a3a9d4
remove comments
jameslamb May 25, 2020
80c07f1
redirect output
jameslamb May 26, 2020
0ec3805
move linting back to Travis
jameslamb May 26, 2020
b1bffdc
change redirection
jameslamb May 26, 2020
52ac67a
to null
jameslamb May 27, 2020
6ac1c95
more null
jameslamb May 27, 2020
a5264bd
quieter
jameslamb May 27, 2020
ba57f13
empty commit
jameslamb May 27, 2020
0d57b3b
empty commit
jameslamb May 27, 2020
010153b
empty commit
jameslamb May 27, 2020
129b8db
empty commit
jameslamb May 27, 2020
d35420a
empty commit
jameslamb May 27, 2020
eab338a
empty commit
jameslamb May 27, 2020
18b7b63
empty commit
jameslamb May 27, 2020
d09aa6c
empty commit
jameslamb May 27, 2020
5a6bf51
empty commit
jameslamb May 27, 2020
92925c5
empty commit
jameslamb May 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ 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
Expand Down
25 changes: 25 additions & 0 deletions .ci/download-miktex.R
Original file line number Diff line number Diff line change
@@ -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))
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.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .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 Down
16 changes: 8 additions & 8 deletions .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ 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', verbose = FALSE)" > $null

# 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"
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"
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex")
Write-Output "Setting up MiKTeX"
Expand All @@ -61,14 +65,10 @@ 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 > $null
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
Expand All @@ -94,8 +94,8 @@ if ($env:COMPILER -ne "MSVC") {
Check-Output $False
}

$note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $?
$relevant_line = $note_str -match '.*Status: (\d+) NOTE.*'
$note_str = Get-Content -Path "${LOG_FILE_NAME}" | Select-String -Pattern '.*Status.* NOTE' | Out-String ; Check-Output $?
$relevant_line = $note_str -match '(\d+) NOTE'
$NUM_CHECK_NOTES = $matches[1]
$ALLOWED_CHECK_NOTES = 3
if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) {
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: GitHub Actions

on: [push]

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
- os: windows-latest
task: r-package
compiler: MINGW
- os: windows-latest
task: r-package
compiler: MSVC
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
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"
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;
fi
if [ -z ${{ matrix.compiler }} ]; then
export COMPILER=${{ matrix.compiler }}
fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
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
- 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"
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ 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:
- os: osx
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

Expand All @@ -45,11 +42,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=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
Expand Down Expand Up @@ -75,7 +73,7 @@ jobs:
pool:
vmImage: 'macOS-10.14'
strategy:
maxParallel: 4
maxParallel: 3
matrix:
regular:
TASK: regular
Expand All @@ -85,8 +83,6 @@ jobs:
PYTHON_VERSION: 3.5
bdist:
TASK: bdist
r_package:
TASK: r-package
steps:
- script: |
echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
Expand All @@ -98,7 +94,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