forked from amzn/amazon-ray
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (122 loc) · 4.81 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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 == 'amzn/amazon-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-east-1
- 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/[email protected]
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=amzn/amazon-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 "//:*"