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

[ci] move Python Mac jobs from Travis to GitHub Actions #3745

Merged
merged 12 commits into from
Jan 10, 2021
80 changes: 80 additions & 0 deletions .github/workflows/python_package.yml
@@ -0,0 +1,80 @@
name: Python-package
StrikerRUS marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CONDA_ENV: test-env
GITHUB_ACTIONS: 'true'

jobs:
test:
name: ${{ matrix.task }} ${{ matrix.method }} (${{ matrix.os }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- os: macOS-latest
task: regular
python_version: 3.6
- os: macOS-latest
task: sdist
python_version: 3.8
- os: macOS-latest
task: bdist
python_version: 3.8
- os: macOS-latest
task: if-else
python_version: 3.8
- os: macOS-latest
task: mpi
method: source
python_version: 3.8
- os: macOS-latest
task: mpi
method: pip
python_version: 3.6
- os: macOS-latest
task: mpi
method: wheel
python_version: 3.7
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 5
submodules: true
- name: Setup and run tests
shell: bash
run: |
export TASK="${{ matrix.task }}"
export METHOD="${{ matrix.method }}"
export COMPILER="${{ matrix.compiler }}"
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
export PYTHON_VERSION="${{ matrix.python_version }}"
if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then
export COMPILER="gcc"
export OS_NAME="macos"
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export COMPILER="clang"
export OS_NAME="linux"
fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export LGB_VER=$(head -n 1 VERSION.txt)
export CONDA=${HOME}/miniconda
export PATH=${CONDA}/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1
all-successful:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Note that all tests succeeded
run: echo "🎉"
20 changes: 2 additions & 18 deletions .travis.yml
Expand Up @@ -8,13 +8,13 @@ git:

os:
- linux
- osx
dist: focal
osx_image: xcode12.2

env:
global: # default values
- COMPILER=clang
- PYTHON_VERSION=3.8
- OS_NAME=linux
matrix:
- TASK=regular PYTHON_VERSION=3.6
- TASK=sdist
Expand All @@ -27,26 +27,10 @@ env:
- TASK=gpu METHOD=pip PYTHON_VERSION=3.6
- TASK=gpu METHOD=wheel PYTHON_VERSION=3.7

matrix:
exclude:
- os: osx
env: TASK=gpu METHOD=source
- os: osx
env: TASK=gpu METHOD=pip PYTHON_VERSION=3.6
- os: osx
env: TASK=gpu METHOD=wheel PYTHON_VERSION=3.7

before_install:
- test -n $CC && unset CC
- test -n $CXX && unset CXX
- export BUILD_DIRECTORY="$TRAVIS_BUILD_DIR"
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
export OS_NAME="macos";
export COMPILER="gcc";
else
export OS_NAME="linux";
export COMPILER="clang";
fi
- export CONDA="$HOME/miniconda"
- export PATH="$CONDA/bin:$PATH"
- export CONDA_ENV="test-env"
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -3,6 +3,7 @@
Light Gradient Boosting Machine
===============================

[![Python-package GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/Python-package/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![R-package GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/R-package/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![Static Analysis GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/Static%20Analysis/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![Azure Pipelines Build Status](https://lightgbm-ci.visualstudio.com/lightgbm-ci/_apis/build/status/Microsoft.LightGBM?branchName=master)](https://lightgbm-ci.visualstudio.com/lightgbm-ci/_build/latest?definitionId=1)
Expand Down