From 2ed3c29c8ab451776a72813cf7d6945972f0d526 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Sat, 29 Oct 2022 06:04:27 +0800 Subject: [PATCH] [CI] Cleanup github action tests. (#8397) - Merge doxygen build with sphinx. - Use mamba on non-windows Github Action. --- .github/workflows/main.yml | 53 ++++++------------------ .github/workflows/python_tests.yml | 22 +++++----- tests/ci_build/conda_env/python_lint.yml | 4 +- 3 files changed, 27 insertions(+), 52 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abe4b2b71..a0b671ff7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,7 @@ jobs: ./tests/ci_build/verify_link.sh ./demo/c-api/build/basic/api-demo ./tests/ci_build/verify_link.sh ./demo/c-api/build/external-memory/external-memory-demo - lint: + cpp-lint: runs-on: ubuntu-latest name: Code linting for C++ steps: @@ -148,43 +148,6 @@ jobs: run: | LINT_LANG=cpp make lint - doxygen: - runs-on: ubuntu-latest - name: Generate C/C++ API doc using Doxygen - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - - uses: actions/setup-python@v2 - with: - python-version: "3.8" - architecture: 'x64' - - name: Install system packages - run: | - sudo apt-get install -y --no-install-recommends doxygen graphviz ninja-build - python -m pip install wheel setuptools - python -m pip install awscli - - name: Run Doxygen - run: | - mkdir build - cd build - cmake .. -DBUILD_C_DOC=ON -GNinja - ninja -v doc_doxygen - - 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: Publish - run: | - cd build/ - tar cvjf ${{ steps.extract_branch.outputs.branch }}.tar.bz2 doc_doxygen/ - python -m awscli s3 cp ./${{ steps.extract_branch.outputs.branch }}.tar.bz2 s3://xgboost-docs/doxygen/ --acl public-read - if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} - sphinx: runs-on: ubuntu-latest name: Build docs using Sphinx @@ -198,8 +161,8 @@ jobs: architecture: 'x64' - name: Install system packages run: | - sudo apt-get install -y --no-install-recommends graphviz - python -m pip install wheel setuptools + sudo apt-get install -y --no-install-recommends graphviz doxygen ninja-build + python -m pip install wheel setuptools awscli python -m pip install -r doc/requirements.txt - name: Extract branch name shell: bash @@ -211,3 +174,13 @@ jobs: make -C doc html env: SPHINX_GIT_BRANCH: ${{ steps.extract_branch.outputs.branch }} + READTHEDOCS: "True" + + - name: Publish + run: | + tar cvjf ${{ steps.extract_branch.outputs.branch }}.tar.bz2 doxygen/doc_doxygen/ + python -m awscli s3 cp ./${{ steps.extract_branch.outputs.branch }}.tar.bz2 s3://xgboost-docs/doxygen/ --acl public-read + if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 2f57117d5..4670ccd10 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -12,16 +12,15 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.8"] steps: - uses: actions/checkout@v2 with: submodules: 'true' - - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - activate-environment: python_lint + cache-downloads: true + cache-env: true + environment-name: python_lint environment-file: tests/ci_build/conda_env/python_lint.yml - name: Display Conda env shell: bash -l {0} @@ -83,6 +82,7 @@ jobs: python-tests-on-win: name: Test XGBoost Python package on ${{ matrix.config.os }} runs-on: ${{ matrix.config.os }} + timeout-minutes: 60 strategy: matrix: config: @@ -130,22 +130,22 @@ jobs: python-tests-on-macos: name: Test XGBoost Python package on ${{ matrix.config.os }} runs-on: ${{ matrix.config.os }} - timeout-minutes: 90 + timeout-minutes: 60 strategy: matrix: config: - - {os: macos-11, python-version "3.8" } + - {os: macos-11} steps: - uses: actions/checkout@v2 with: submodules: 'true' - - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/provision-with-micromamba@main with: - auto-update-conda: true - python-version: ${{ matrix.config.python-version }} - activate-environment: macos_test + cache-downloads: true + cache-env: true + environment-name: macos_test environment-file: tests/ci_build/conda_env/macos_cpu_test.yml - name: Display Conda env diff --git a/tests/ci_build/conda_env/python_lint.yml b/tests/ci_build/conda_env/python_lint.yml index a998ca9a4..a64f649a2 100644 --- a/tests/ci_build/conda_env/python_lint.yml +++ b/tests/ci_build/conda_env/python_lint.yml @@ -15,7 +15,9 @@ dependencies: - distributed - black - isort -- pyspark - cloudpickle - pytest - hypothesis +- pip: + # TODO: Replace it with pyspark>=3.4 once 3.4 released. + - https://ml-team-public-read.s3.us-west-2.amazonaws.com/pyspark-3.4.0.dev0.tar.gz