|
6 | 6 | # Helpful YAML parser to clarify YAML syntax:
|
7 | 7 | # https://yaml-online-parser.appspot.com/
|
8 | 8 |
|
9 |
| -# For now, we only use GitHub Actions for lint checks, pending better |
10 |
| -# support for hermetic-style caching. See: |
11 |
| -# https://github.com/actions/cache/issues/109 |
12 | 9 | name: CI
|
13 | 10 |
|
14 | 11 | on:
|
|
20 | 17 | pull_request: {}
|
21 | 18 |
|
22 | 19 | env:
|
| 20 | + # Keep this Bazel version in sync with the `versions.check` directive |
| 21 | + # in our WORKSPACE file. |
| 22 | + BAZEL_VERSION: '3.7.0' |
| 23 | + BAZEL_SHA256SUM: 'b7583eec83cc38302997098a40b8c870c37e0ab971a83cb3364c754a178b74ec' |
23 | 24 | BUILDTOOLS_VERSION: '3.0.0'
|
24 | 25 | BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
|
25 | 26 | BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'
|
26 | 27 |
|
27 | 28 | jobs:
|
| 29 | + build: |
| 30 | + runs-on: ubuntu-16.04 |
| 31 | + needs: lint-python-flake8 # fail fast in case of "undefined variable" errors |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + tf_version_id: ['tf-nightly', 'notf'] |
| 36 | + python_version: ['3.7'] |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v1 |
| 39 | + - uses: actions/setup-python@v1 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python_version }} |
| 42 | + architecture: 'x64' |
| 43 | + - name: 'Set up Bazel' |
| 44 | + run: | |
| 45 | + ci/download_bazel.sh "${BAZEL_VERSION}" "${BAZEL_SHA256SUM}" ~/bazel |
| 46 | + sudo mv ~/bazel /usr/local/bin/bazel |
| 47 | + sudo chmod +x /usr/local/bin/bazel |
| 48 | + cp ./ci/bazelrc ~/.bazelrc |
| 49 | + - name: 'Configure build cache write credentials' |
| 50 | + env: |
| 51 | + CREDS: ${{ secrets.BAZEL_CACHE_SERVICE_ACCOUNT_CREDS }} |
| 52 | + EVENT_TYPE: ${{ github.event_name }} |
| 53 | + run: | |
| 54 | + if [ -z "${CREDS}" ]; then |
| 55 | + printf 'Using read-only cache (no credentials)\n' |
| 56 | + exit |
| 57 | + fi |
| 58 | + if [ "${EVENT_TYPE}" = pull_request ]; then |
| 59 | + printf 'Using read-only cache (PR build)\n' |
| 60 | + exit |
| 61 | + fi |
| 62 | + printf 'Using writable cache\n' |
| 63 | + creds_file=/tmp/service_account_creds.json |
| 64 | + printf '%s\n' "${CREDS}" >"${creds_file}" |
| 65 | + printf '%s\n' >>~/.bazelrc \ |
| 66 | + "common --google_credentials=${creds_file}" \ |
| 67 | + "common --remote_upload_local_results=true" \ |
| 68 | + ; |
| 69 | + - name: 'Install Python dependencies' |
| 70 | + run: | |
| 71 | + python -m pip install -U pip |
| 72 | + pip install \ |
| 73 | + -r ./tensorboard/pip_package/requirements.txt \ |
| 74 | + -r ./tensorboard/pip_package/requirements_dev.txt \ |
| 75 | + ; |
| 76 | + - name: 'Install TensorFlow' |
| 77 | + run: pip install "${{ matrix.tf_version_id }}" |
| 78 | + if: matrix.tf_version_id != 'notf' |
| 79 | + - name: 'Check Pip state' |
| 80 | + run: pip freeze --all |
| 81 | + - name: 'Bazel: fetch' |
| 82 | + run: bazel fetch //tensorboard/... |
| 83 | + - name: 'Bazel: build' |
| 84 | + run: bazel build //tensorboard/... |
| 85 | + - name: 'Bazel: test (with TensorFlow support)' |
| 86 | + run: bazel test //tensorboard/... |
| 87 | + if: matrix.tf_version_id != 'notf' |
| 88 | + - name: 'Bazel: test (non-TensorFlow only)' |
| 89 | + run: bazel test //tensorboard/... --test_tag_filters="support_notf" |
| 90 | + if: matrix.tf_version_id == 'notf' |
| 91 | + - name: 'Bazel: run Pip package test' |
| 92 | + run: | |
| 93 | + bazel run //tensorboard/pip_package:test_pip_package -- \ |
| 94 | + --tf-version "${{ matrix.tf_version_id }}" |
| 95 | + - name: 'Bazel: run manual tests' |
| 96 | + run: | |
| 97 | + bazel test //tensorboard/compat/tensorflow_stub:gfile_s3_test && |
| 98 | + bazel test //tensorboard/summary/writer:event_file_writer_s3_test |
| 99 | +
|
28 | 100 | lint-python-flake8:
|
29 | 101 | runs-on: ubuntu-16.04
|
30 | 102 | strategy:
|
|
0 commit comments