-
Notifications
You must be signed in to change notification settings - Fork 612
118 lines (115 loc) · 3.5 KB
/
ci_test.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
name: GitHub CI
on:
push:
branches:
- master
- r*
pull_request:
branches:
- master
- r*
permissions:
contents: read
jobs:
flake8-test:
name: Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run flake8
run: bash tools/run_build.sh flake8-test
black-test:
name: Black Python code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Ensure contributor used ("black ./") before commit
run: bash tools/run_build.sh black-test
source_code_test:
name: Check that the source code is compliant
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run type check
run: bash tools/run_build.sh source_code_test
valid_build_files:
name: Valid build files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run type check
run: bash tools/run_build.sh valid_build_files
clang-format:
name: Clang C++ code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run type check
run: bash tools/run_build.sh clang-format
check-bazel-format:
name: Bazel code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run type check
run: bash tools/run_build.sh check-bazel-format
pre-commit:
name: Check that the pre-commit works
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checking the pre-commit
run: bash tools/pre-commit.sh
docs_tests:
name: Check that we can build the docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Building the docs
run: bash tools/run_build.sh docs_tests
test_python_code_only:
name: Fast build to run python-only tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
with:
python-version: 3.9
- uses: actions/checkout@v2
- run: pip install --default-timeout=1000 -r tools/install_deps/tensorflow-cpu.txt -r tools/install_deps/pytest.txt
- run: pip install -e ./
- run: pytest -v -n auto --skip-custom-ops ./tensorflow_addons
test_cpu_in_small_docker_image:
name: Run the cpu tests in a small python docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: bash tools/run_cpu_tests.sh
nbfmt:
name: Notebook format
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- name: Install tensorflow-docs
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
- name: Check notebook formatting
run: |
# Run on all notebooks to prevent upstream change.
echo "Check formatting with nbfmt:"
python3 -m tensorflow_docs.tools.nbfmt --test \
$(find docs/tutorials/ -type f -name *.ipynb)
nblint:
name: Notebook lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- name: Install tensorflow-docs
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
- name: Lint notebooks
run: |
# Run on all notebooks to prevent upstream change.
echo "Lint check with nblint:"
python3 -m tensorflow_docs.tools.nblint \
--arg=repo:tensorflow/addons \
$(find docs/tutorials/ -type f -name *.ipynb ! -path "docs/tutorials/_template.ipynb")