diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a929f846..4a6273230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,6 +39,13 @@ jobs: with: # we need full history to diff against the original for linting etc. fetch-depth: 0 + - name: Configure AWS Credentials + continue-on-error: true + 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: Run CI script shell: bash -e -o pipefail -l {0} env: @@ -53,6 +60,7 @@ jobs: . ./ci/travis/ci.sh init . ./ci/travis/ci.sh lint . ./ci/travis/ci.sh build + . ./ci/travis/ci.sh upload_wheels || true . ./ci/travis/ci.sh test_python . ./ci/travis/ci.sh test_wheels - name: Run Clang Include-What-You-Use diff --git a/ci/travis/ci.sh b/ci/travis/ci.sh index 2f4914e56..fe2252789 100755 --- a/ci/travis/ci.sh +++ b/ci/travis/ci.sh @@ -78,6 +78,23 @@ need_wheels() { return "${error_code}" } +upload_wheels() { + local branch="" commit + commit="$(git rev-parse --verify HEAD)" + if [ -z "${branch}" ]; then branch="${TRAVIS_BRANCH-}"; fi + if [ -z "${branch}" ]; then branch="${GITHUB_BASE_REF-}"; fi + if [ -z "${branch}" ]; then branch="${GITHUB_REF#refs/heads/}"; fi + if [ -z "${branch}" ]; then echo "Unable to detect branch name" 1>&2; return 1; fi + local local_dir="python/dist" + local remote_dir="${branch}/${commit}" + if [ -d "${local_dir}" ]; then + if command -V aws; then + aws s3 sync --acl public-read --no-progress "${local_dir}" "s3://ray-wheels/${remote_dir}" + fi + fi +} + + test_python() { if [ "${OSTYPE}" = msys ]; then # Windows -- most tests won't work yet; just do the ones we know work diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index 09f196795..16f473f7a 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -60,6 +60,9 @@ install_miniconda() { ;; esac reload_env + if [ -n "${PYTHON-}" ]; then + conda install -q -y python="${PYTHON}" + fi python -m pip install --upgrade --quiet pip }