From 4baf4a86ddc8a18f08f33b6d3840d9399c656596 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Tue, 23 Nov 2021 06:22:08 -0800 Subject: [PATCH 1/4] [CI] Fix continuous delivery pipeline for MacOS (#7472) --- .github/workflows/python_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 9252de20c695..b0c0c34429f9 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -117,7 +117,7 @@ jobs: shell: bash -l {0} if: | (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && - matrix.os == 'macos-latest' + matrix.os == 'macos-10.15' run: | python -m awscli s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/ --acl public-read env: From 82b97333e3fa5f824e0d456bdb80fe2cfdbd3614 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Wed, 24 Nov 2021 00:29:11 +0800 Subject: [PATCH 2/4] Fix github macos package upload. (#7474) --- .github/workflows/python_tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index b0c0c34429f9..7e28e73aa144 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -116,8 +116,7 @@ jobs: - name: Upload Python wheel shell: bash -l {0} if: | - (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && - matrix.os == 'macos-10.15' + (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && matrix.config.os == 'macos-10.15' run: | python -m awscli s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/ --acl public-read env: From 11a87910a65134449fac975bfffe7d7cdef62bf5 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Wed, 24 Nov 2021 03:43:49 +0800 Subject: [PATCH 3/4] Fix macos package upload. (#7475) * Split up the tests. --- .github/workflows/python_tests.yml | 50 +++++++++++++++++---- tests/ci_build/conda_env/macos_cpu_test.yml | 2 +- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 7e28e73aa144..092753719c70 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -45,14 +45,13 @@ jobs: cd .. python -c 'import xgboost' - python-tests: + python-tests-on-win: name: Test XGBoost Python package on ${{ matrix.config.os }} runs-on: ${{ matrix.config.os }} strategy: matrix: config: - {os: windows-2016, python-version: '3.8'} - - {os: macos-10.15, python-version "3.8" } steps: - uses: actions/checkout@v2 @@ -63,7 +62,7 @@ jobs: with: auto-update-conda: true python-version: ${{ matrix.config.python-version }} - activate-environment: win64_test + activate-environment: win64_env environment-file: tests/ci_build/conda_env/win64_cpu_test.yml - name: Display Conda env @@ -74,15 +73,52 @@ jobs: - name: Build XGBoost on Windows shell: bash -l {0} - if: matrix.config.os == 'windows-2016' run: | mkdir build_msvc cd build_msvc cmake .. -G"Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPES="Release" -A x64 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON cmake --build . --config Release --parallel $(nproc) + - name: Install Python package + shell: bash -l {0} + run: | + cd python-package + python --version + python setup.py bdist_wheel --universal + pip install ./dist/*.whl + + - name: Test Python package + shell: bash -l {0} + run: | + pytest -s -v ./tests/python + + python-tests-on-macos: + name: Test XGBoost Python package on ${{ matrix.config.os }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - {os: macos-10.15, python-version "3.8" } + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.config.python-version }} + activate-environment: macos_test + environment-file: tests/ci_build/conda_env/macos_cpu_test.yml + + - name: Display Conda env + shell: bash -l {0} + run: | + conda info + conda list + - name: Build XGBoost on macos - if: matrix.config.os == 'macos-10.15' run: | wget https://raw.githubusercontent.com/Homebrew/homebrew-core/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -O $(find $(brew --repository) -name libomp.rb) brew install ninja libomp @@ -108,15 +144,13 @@ jobs: - name: Rename Python wheel shell: bash -l {0} - if: matrix.config.os == 'macos-10.15' run: | TAG=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64 python tests/ci_build/rename_whl.py python-package/dist/*.whl ${{ github.sha }} ${TAG} - name: Upload Python wheel shell: bash -l {0} - if: | - (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && matrix.config.os == 'macos-10.15' + if: (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) run: | python -m awscli s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/ --acl public-read env: diff --git a/tests/ci_build/conda_env/macos_cpu_test.yml b/tests/ci_build/conda_env/macos_cpu_test.yml index 6a9092b2bbf0..4f1d006f3207 100644 --- a/tests/ci_build/conda_env/macos_cpu_test.yml +++ b/tests/ci_build/conda_env/macos_cpu_test.yml @@ -1,4 +1,4 @@ -name: cpu_test +name: macos_test channels: - conda-forge dependencies: From 8387c95e8b48c1857c318cb8b1b256a2fe457378 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Wed, 24 Nov 2021 01:35:59 -0800 Subject: [PATCH 4/4] [CI] Add missing step extract_branch (#7479) --- .github/workflows/python_tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 092753719c70..fb5b85f2bd31 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -148,9 +148,15 @@ jobs: TAG=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64 python tests/ci_build/rename_whl.py python-package/dist/*.whl ${{ github.sha }} ${TAG} + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') + - name: Upload Python wheel shell: bash -l {0} - if: (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) + if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') run: | python -m awscli s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/ --acl public-read env: