mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
Windows CI for Ray on github actions (#6519)
* Windows CI for Ray * Update main.yml * Does this work? * Download Bazel to current directory * Install required packages via Chocolatey * Improve the Windows CI script
This commit is contained in:
committed by
Edward Oakes
parent
6725a61bda
commit
bbe5d83eb8
@@ -0,0 +1,97 @@
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Github Actions requires a single row to be added to the build matrix.
|
||||
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
|
||||
name: [
|
||||
windows-clang-cl,
|
||||
]
|
||||
include:
|
||||
- name: windows-clang-cl
|
||||
os: windows-latest
|
||||
compiler: clang-cl
|
||||
steps:
|
||||
- name: Install Bazel
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${OSTYPE}" = "msys" ]; then
|
||||
choco install --no-progress bazel
|
||||
fi
|
||||
- name: Install C/C++ toolchains
|
||||
if: matrix.compiler == 'clang' || matrix.compiler == 'clang-cl'
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${OSTYPE}" = "msys" ]; then
|
||||
choco install --no-progress llvm
|
||||
elif 1>&- command -v pacman; then
|
||||
sudo pacman -S --needed --noconfirm --noprogressbar clang
|
||||
elif 1>&- command -v apt-get; then
|
||||
sudo apt-get -q -y install clang
|
||||
fi
|
||||
- name: Install MSYS2 (only needed if some shell commands are missing)
|
||||
if: false && runner.os == 'Windows'
|
||||
uses: numworks/setup-msys2@v1
|
||||
with:
|
||||
update: false
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Perform build
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
main() {
|
||||
if [ "${OSTYPE}" = "msys" ]; then
|
||||
export MSYS2_ARG_CONV_EXCL="*" # Don't let MSYS2 attempt to auto-translate arguments that look like paths
|
||||
local latest_python_bin=""
|
||||
for latest_python_bin in /proc/registry/HKEY_LOCAL_MACHINE/Software/Python/PythonCore/*/InstallPath/@; do
|
||||
if [ -f "${latest_python_bin}" ]; then
|
||||
latest_python_bin="$(tr -d '\0' < "${latest_python_bin}")"
|
||||
latest_python_bin="${latest_python_bin}\\"
|
||||
else
|
||||
latest_python_bin=""
|
||||
fi
|
||||
done
|
||||
latest_python_bin="${latest_python_bin}python.exe"
|
||||
if [ -f "${latest_python_bin}" ]; then
|
||||
export PYTHON2_BIN_PATH="${latest_python_bin}" PYTHON3_BIN_PATH="${latest_python_bin}"
|
||||
fi
|
||||
fi
|
||||
# NOTE: Only options that are _user preferences_ (i.e. not repository-specific) should go here.
|
||||
# These are options that people may disagree on having on their own machines, but which are useful for our builds.
|
||||
bazel_output_root="${HOME}/bazel"
|
||||
if [ "${OSTYPE}" = "msys" ]; then
|
||||
bazel_output_root="$(cygpath -w -- "${bazel_output_root}")"
|
||||
fi
|
||||
local startflags=()
|
||||
startflags+=(--batch)
|
||||
startflags+=(--nodeep_execroot)
|
||||
#startflags+=(--output_user_root="${bazel_output_root}")
|
||||
local cmdflags=()
|
||||
cmdflags+=(--attempt_to_print_relative_paths)
|
||||
cmdflags+=(--color=yes)
|
||||
cmdflags+=(--experimental_repository_cache_hardlinks)
|
||||
cmdflags+=(--experimental_ui_deduplicate)
|
||||
cmdflags+=(--incompatible_strict_action_env)
|
||||
cmdflags+=(--keep_going)
|
||||
cmdflags+=(--per_file_copt="-\\.(asm|S)$@-fansi-escape-codes")
|
||||
cmdflags+=(--per_file_copt="-\\.(asm|S)$@-fcolor-diagnostics")
|
||||
cmdflags+=(--show_progress_rate_limit=5)
|
||||
cmdflags+=(--show_task_finish)
|
||||
cmdflags+=(--show_timestamps)
|
||||
cmdflags+=(--symlink_prefix=/)
|
||||
cmdflags+=(--verbose_failures)
|
||||
local packages=()
|
||||
packages+=("//:ray_pkg")
|
||||
bazel "${startflags[@]}" build "${cmdflags[@]}" "${packages[@]}" "$@"
|
||||
}
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user