mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 04:28:06 +08:00
Fix & improve GitHub Actions CI builds (#7784)
This commit is contained in:
+32
-58
@@ -1,79 +1,44 @@
|
||||
name: CI
|
||||
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
iwyu:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
name: [
|
||||
ubuntu-clang-iwyu,
|
||||
]
|
||||
include:
|
||||
- name: ubuntu-clang-iwyu
|
||||
os: ubuntu-latest
|
||||
compiler: clang
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Setup Bazel
|
||||
shell: bash
|
||||
env:
|
||||
BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./ci/travis/install-bazel.sh
|
||||
- name: Setup Clang Include-What-You-Use
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install iwyu
|
||||
- name: Perform build
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
run: |
|
||||
# TODO(mehrdadn): Replace this with the same build script as below, once we factor that out
|
||||
. ./ci/travis/build-helper.sh prep_build_env
|
||||
bazel --batch build \
|
||||
--compilation_mode=fastbuild \
|
||||
--config=iwyu \
|
||||
--keep_going \
|
||||
"//:*"
|
||||
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,
|
||||
]
|
||||
# Useful info: https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
||||
include:
|
||||
- name: windows-clang-cl
|
||||
os: windows-latest
|
||||
- name: ubuntu-clang
|
||||
os: ubuntu-16.04
|
||||
compiler: clang
|
||||
- name: windows-clang
|
||||
os: windows-2019
|
||||
compiler: clang-cl
|
||||
- name: macos-clang
|
||||
os: macos-10.15
|
||||
compiler: clang
|
||||
steps:
|
||||
- name: Configure Git
|
||||
# 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: |
|
||||
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@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Setup Bazel
|
||||
shell: bash
|
||||
shell: bash -e -o pipefail -l {0}
|
||||
env:
|
||||
BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./ci/travis/install-bazel.sh
|
||||
- name: Install C/C++ toolchains
|
||||
if: matrix.compiler == 'clang' || matrix.compiler == 'clang-cl'
|
||||
shell: bash
|
||||
shell: bash -e -o pipefail -l {0}
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
run: ./ci/travis/install-toolchains.sh "${CC%%-*}"
|
||||
@@ -83,9 +48,18 @@ jobs:
|
||||
with:
|
||||
update: false
|
||||
- name: Perform build
|
||||
shell: bash
|
||||
shell: bash -e -o pipefail -l {0}
|
||||
run: |
|
||||
. ./ci/travis/build-helper.sh prep_build_env
|
||||
bazel --batch build \
|
||||
bazel build \
|
||||
--keep_going \
|
||||
"//:ray_pkg" # TODO(mehrdadn): Should be "//:*", but we get a linking error with _streaming.so
|
||||
"//:*"
|
||||
- name: Run Clang Include-What-You-Use
|
||||
continue-on-error: true
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash -e -o pipefail -l {0}
|
||||
run: |
|
||||
sudo apt-get install -qq -o=Dpkg::Use-Pty=0 iwyu
|
||||
bazel build \
|
||||
--keep_going \
|
||||
--config=iwyu \
|
||||
"//:*"
|
||||
|
||||
Reference in New Issue
Block a user