-
Notifications
You must be signed in to change notification settings - Fork 651
194 lines (173 loc) · 5.99 KB
/
ci-build-checks.yaml
File metadata and controls
194 lines (173 loc) · 5.99 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Copyright 2025 The TensorFlow Quantum Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'CI: build & test'
run-name: Continuous integration build and test
on:
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
push:
branches:
- main
# Allow manual invocation, with options that can be useful for debugging.
workflow_dispatch:
inputs:
sha:
description: 'SHA of commit to run against:'
type: string
required: true
python_ver:
description: 'Python version:'
type: string
default: '3.10.15'
extra_bazel_options:
description: 'Extra Bazel options:'
type: string
remake_python_cache:
description: 'Delete & remake the Python cache'
type: boolean
default: false
debug:
description: 'Print additional workflow info'
type: boolean
default: false
env:
# Default Python version to use. Important: give it a full x.y.z number.
python_ver: '3.10.15'
# Additional .bazelrc options to use.
bazelrc_additions: |
common -c opt
common --announce_rc
common --color=no
common --experimental_repo_remote_exec
common --remote_upload_local_results=false
common --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1"
common --cxxopt="-std=c++17"
common --cxxopt="-msse2"
common --cxxopt="-msse3"
common --cxxopt="-msse4"
build --verbose_failures
build --auto_output_filter=none
build --show_progress_rate_limit=1
test --test_output=errors
test --test_summary=detailed
# Note: these regexes are Bash regex syntax, NOT path glob syntax.
# Also, do not put dashes in front of the values.
ignore_patterns: |-
.*\.md$
.*\.jpg$
.*\.png$
^\.gitignore
^\.pylintrc
^\.yamllint.yaml
^\.github/problem-matchers/.*
^benchmarks/.*
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}
permissions: read-all
jobs:
wheel-build:
name: Wheel test
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
- name: Build Wheel Test
run: ./scripts/build_pip_package_test.sh
- name: Test Wheel
run: ./scripts/run_example.sh
bazel-tests:
name: Library tests
runs-on: linux-x86-n2-32
container:
image: us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:infrastructure-public-image-82c7ac59ba4b
timeout-minutes: 60
steps:
- name: Adjust the ml-build runner to our needs
run: |
# lsb-release (needed by setup-python) is missing in ml-build runners
sudo apt-get update && sudo apt-get install -y lsb-release
# This file, though it's empty, hangs the Bazel install step.
rm -f /etc/bazel.bazelrc
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
- name: Configure CI TF
run: echo "Y\n" | ./configure.sh
- name: Full Library Test
run: ./scripts/test_all.sh
# 2024-11-30 [mhucka] temporarily turning off leak-tests because it produces
# false positives on GH that we can't immediately address. TODO: if updating
# TFQ to use Clang and the latest TF does not resolve this, find a way to
# skip the handful of failing tests and renable the rest of the msan tests.
#
# leak-tests:
# name: Memory Leak tests
# runs-on: ubuntu-22.04
#
# steps:
# - uses: actions/checkout@v1
# - uses: actions/setup-python@v1
# with:
# python-version: '3.10'
# architecture: 'x64'
# - name: Install Bazel on CI
# run: ./scripts/ci_install.sh
# - name: Configure CI TF
# run: echo "Y\n" | ./configure.sh
# - name: Leak Test qsim and src
# run: ./scripts/msan_test.sh
tutorials-test:
name: Tutorial tests
runs-on: linux-x86-n2-32
container:
image: us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:infrastructure-public-image-82c7ac59ba4b
timeout-minutes: 60
steps:
- name: Adjust the ml-build runner to our needs
run: |
# lsb-release (needed by setup-python) is missing in ml-build runners
sudo apt-get update && sudo apt-get install -y lsb-release
# This file, though it's empty, hangs the Bazel install step.
rm -f /etc/bazel.bazelrc
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install notebook dependencies
run: pip install --upgrade pip seaborn==0.10.0
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
- name: Build Wheel
run: ./scripts/build_pip_package_test.sh
- name: Test Notebooks
run: ./scripts/ci_validate_tutorials.sh