ray/.github/workflows/main.yml
2020-08-19 15:43:03 -07:00

96 lines
3.7 KiB
YAML

name: CI
on: [push, 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
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: Run CI script
shell: bash -e -o pipefail -l {0}
env:
BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#LINUX_WHEELS: 1
#MAC_WHEELS: 1
RAY_DEFAULT_BUILD: 1
WINDOWS_WHEELS: 1
run: |
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
. ./ci/travis/ci.sh test_python
. ./ci/travis/ci.sh test_core
. ./ci/travis/ci.sh test_wheels
- 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 "//:*"