-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] move Python Mac jobs from Travis to GitHub Actions (#3745)
* [ci] move Python Mac jobs from Travis to GitHub Actions * alphabetize * fix workflow * fix name * fix os * new workflow * Apply suggestions from code review Co-authored-by: Nikita Titov <[email protected]> * changes from code review * swap compilers * swap compilers back * Apply suggestions from code review Co-authored-by: Nikita Titov <[email protected]> * Update .github/workflows/python_package.yml Co-authored-by: Nikita Titov <[email protected]>
- Loading branch information
1 parent
d6f6abf
commit c7c4e08
Showing
3 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Python-package | ||
|
||
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 }}, Python ${{ matrix.python_version }}) | ||
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/[email protected] | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
- name: Setup and run tests | ||
shell: bash | ||
run: | | ||
export TASK="${{ matrix.task }}" | ||
export METHOD="${{ matrix.method }}" | ||
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 "🎉" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters