123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- name: CI
- on:
- push:
- branches-ignore:
- # Don't run CI for Dependabot branch pushes.
- - "dependabot/**"
- pull_request:
- env:
- # Git GITHUB_... variables are useful for translating Travis environment variables
- GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }}
- GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- GITHUB_PULL_REQUEST: ${{ github.event.number }}
- jobs:
- build:
- name: ${{ matrix.name }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- # Useful info: https://help.github.com/en/articles/workflow-syntax-for-github-actions
- include:
- - name: windows-msvc
- os: windows-2019
- python-version: 3.8
- # Can be 'msvc' or 'clang-cl'
- config: msvc-cl
- env:
- BAZEL_CONFIG: ${{ matrix.config }}
- PYTHON: ${{ matrix.python-version }}
- TRAVIS_COMMIT: ${{ github.sha }}
- #TRAVIS_PULL_REQUEST is defined in the scripts to account for "false"
- steps:
- - name: Pre-checkout system configuration
- # We add -l to process .bashrc, but need -e -o pipefail for consistency with GitHub Actions's default behavior.
- shell: bash -e -o pipefail -l {0}
- run: |
- # Note: only configure settings here that are required _before_ the repository is cloned (such as Git settings).
- # Different machines behave very differently with Bash initialization -- make them more uniform
- rm -f -- ~/.bash_profile ~/.profile ~/.bashrc
- printf '\n%s\n' 'if [ -n "${BASH_VERSION}" ] && [ -f ~/.bashrc ]; then . ~/.bashrc; fi' >> ~/.profile
- git config --global core.symlinks true && git config --global core.autocrlf false
- if command -v dpkg > /dev/null; then sudo dpkg-reconfigure debconf -f noninteractive -p high; fi
- - name: Checkout repository
- uses: actions/checkout@v1
- - name: Configure AWS Credentials
- continue-on-error: true
- if: github.repository == 'ray-project/ray' && github.event_name != 'pull_request'
- uses: aws-actions/configure-aws-credentials@v1
- with:
- aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
- aws-region: us-west-2
- - name: Prepare caching
- id: info
- shell: bash
- run: |
- case "${OSTYPE}" in
- linux*) pip_cache=~/.cache/pip;;
- darwin*) pip_cache=~/Library/Caches/pip;;
- msys) pip_cache="${LOCALAPPDATA}\pip\Cache";;
- esac
- cat <<-EOF
- ::set-output name=git_tree_hash::$(git cat-file -p HEAD | sed -n "s/^tree //p")
- ::set-output name=pip_cache::${pip_cache}
- EOF
- - name: Cache (pip)
- uses: actions/cache@v1.1.2
- continue-on-error: true
- if: steps.info.outputs.pip_cache
- with:
- path: ${{ steps.info.outputs.pip_cache }}
- key: |
- pip-${{ runner.os }}-${{ steps.info.outputs.git_tree_hash }}
- restore-keys: |
- pip-${{ runner.os }}-
- pip-
- - name: Build
- shell: bash -x -e -o pipefail -l {0}
- env:
- BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- RAY_DEFAULT_BUILD: 1
- WINDOWS_WHEELS: 1
- BAZEL_LOG_BUCKET_ACCESS_KEY: ${{ secrets.BAZEL_LOG_BUCKET_ACCESS_KEY }}
- TRAVIS_BRANCH: ${{ github.ref }}
- TRAVIS_COMMIT: ${{ github.sha }}
- TRAVIS_JOB_ID: ${{ github.run_id }}
- run: |
- function clean_up() {
- echo "Performing cleanup"
- if [ "${GITHUB_EVENT_NAME}" != "pull_request" ]; then ./ci/travis/upload_build_info.sh; fi
- }
- trap clean_up EXIT
- python -u ci/remote-watch.py --skip_repo=ray-project/ray &
- . ./ci/travis/ci.sh init
- . ./ci/travis/ci.sh build
- . ./ci/travis/ci.sh upload_wheels || true
- - name: Run Tests
- shell: bash -x -e -o pipefail -l {0}
- env:
- BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- RAY_DEFAULT_BUILD: 1
- WINDOWS_WHEELS: 1
- BAZEL_LOG_BUCKET_ACCESS_KEY: ${{ secrets.BAZEL_LOG_BUCKET_ACCESS_KEY }}
- TRAVIS_BRANCH: ${{ github.ref }}
- TRAVIS_COMMIT: ${{ github.sha }}
- TRAVIS_JOB_ID: ${{ github.run_id }}
- run: |
- function clean_up() {
- echo "Performing cleanup"
- if [ "${GITHUB_EVENT_NAME}" != "pull_request" ]; then ./ci/travis/upload_build_info.sh; fi
- }
- trap clean_up EXIT
- python -u ci/remote-watch.py --skip_repo=ray-project/ray &
- . ./ci/travis/ci.sh test_core
- . ./ci/travis/ci.sh test_python
- - name: Run Clang Include-What-You-Use
- continue-on-error: true
- if: runner.os == 'Linux'
- shell: bash -e -o pipefail -l {0}
- run: ci/travis/iwyu.sh process "//:*"
|