|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name: CI |
|
|
|
on: |
|
push: |
|
branches: |
|
- master |
|
- '[0-9]+.*' |
|
- 'ci-*' |
|
pull_request: {} |
|
|
|
env: |
|
BUILDTOOLS_VERSION: '3.0.0' |
|
BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db' |
|
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d' |
|
|
|
jobs: |
|
lint-python-flake8: |
|
runs-on: ubuntu-16.04 |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
|
|
|
|
|
|
python_version: ['3.5', '3.7'] |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- uses: actions/setup-python@v1 |
|
with: |
|
python-version: ${{ matrix.python_version }} |
|
architecture: 'x64' |
|
- name: 'Install flake8' |
|
run: | |
|
python -m pip install -U pip |
|
pip install flake8 -c ./tensorboard/pip_package/requirements_dev.txt |
|
- run: pip freeze --all |
|
- name: 'Lint Python code for errors with flake8' |
|
|
|
|
|
run: flake8 . --count --select=E9,F63,F7,F82,F401 --show-source --statistics |
|
|
|
lint-python: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- uses: actions/setup-python@v1 |
|
with: |
|
python-version: '3.6' |
|
architecture: 'x64' |
|
- name: 'Install black' |
|
run: | |
|
python -m pip install -U pip |
|
pip install black -c ./tensorboard/pip_package/requirements_dev.txt |
|
- run: pip freeze --all |
|
- name: 'Lint Python code for style with Black' |
|
|
|
run: black --check --diff . |
|
|
|
lint-docs: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- uses: actions/setup-python@v1 |
|
with: |
|
python-version: '3.6' |
|
architecture: 'x64' |
|
- name: 'Install yamllint' |
|
run: | |
|
python -m pip install -U pip |
|
pip install yamllint -c ./tensorboard/pip_package/requirements_dev.txt |
|
- run: pip freeze --all |
|
- name: 'Lint YAML for gotchas with yamllint' |
|
|
|
run: yamllint -c docs/.yamllint docs docs/.yamllint |
|
- name: 'Install the TensorFlow docs notebook tools' |
|
run: | |
|
nbfmt_version="174c9a5c1cc51a3af1de98d84824c811ecd49029" |
|
python3 -m pip install -U git+https://github.com/tensorflow/docs@${nbfmt_version} |
|
- name: 'Use nbfmt to check Colab notebooks for formatting' |
|
run: git ls-files -z '*.ipynb' | xargs -0 python3 -m tensorflow_docs.tools.nbfmt --test |
|
|
|
lint-frontend: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- uses: actions/setup-node@v1 |
|
- run: yarn install --ignore-engines |
|
|
|
- run: yarn lint |
|
|
|
- run: | |
|
! git grep -E 'f(it|describe)\(' 'tensorboard/*_test.ts' |
|
|
|
|
|
- run: | |
|
! git grep -E '"@npm//@angular/material"|"@npm//@angular/cdk"' 'tensorboard/*/BUILD' ':!tensorboard/webapp/BUILD' ':!tensorboard/webapp/angular/BUILD' |
|
|
|
|
|
- run: | |
|
! git grep -E '@npm//d3' 'tensorboard/webapp/**/*BUILD' ':!tensorboard/webapp/third_party/**' |
|
|
|
lint-build: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- name: 'Set up Buildifier' |
|
run: | |
|
ci/download_buildifier.sh "${BUILDTOOLS_VERSION}" "${BUILDIFIER_SHA256SUM}" ~/buildifier |
|
sudo mv ~/buildifier /usr/local/bin/buildifier |
|
- name: 'Set up Buildozer' |
|
run: | |
|
ci/download_buildozer.sh "${BUILDTOOLS_VERSION}" "${BUILDOZER_SHA256SUM}" ~/buildozer |
|
sudo mv ~/buildozer /usr/local/bin/buildozer |
|
- name: 'Lint BUILD files' |
|
|
|
run: |
|
git ls-files -z '*BUILD' third_party/js.bzl third_party/workspace.bzl | xargs -0 buildifier --mode=check --lint=warn |
|
--warnings=-native-py,-native-java |
|
- run: ./tensorboard/tools/mirror_urls_test.sh |
|
- name: 'Lint for no py2 BUILD targets' |
|
|
|
run: | |
|
! git grep 'python_version = "PY2"' '*BUILD' |
|
- name: 'No comments on licenses rule' |
|
|
|
|
|
run: | |
|
buildozer '//tensorboard/...:%licenses' remove_comment && false || test $? = 3 |
|
|
|
lint-proto: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- name: clang-format lint |
|
uses: DoozyX/clang-format-lint-action@v0.5 |
|
with: |
|
source: ./tensorboard |
|
|
|
exclude: ./tensorboard/compat/proto |
|
extensions: 'proto' |
|
clangFormatVersion: 9 |
|
|
|
check-misc: |
|
runs-on: ubuntu-16.04 |
|
steps: |
|
- uses: actions/checkout@v1 |
|
- run: ./tensorboard/tools/do_not_submit_test.sh |
|
- run: ./tensorboard/tools/license_test.sh |
|
- run: ./tensorboard/tools/whitespace_hygiene_test.py |
|
|