-
Notifications
You must be signed in to change notification settings - Fork 651
184 lines (154 loc) · 5.74 KB
/
ci.yaml
File metadata and controls
184 lines (154 loc) · 5.74 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
# 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
run-name: >-
Run CI checks on ${{
github.event_name == 'pull_request'
&& format('PR #{0}', github.event.pull_request.number)
|| github.event_name
}} by @${{github.actor}}
on:
pull_request:
branches:
- master
merge_group:
types:
- checks_requested
env:
# Python version to use for actions/setup-python.
python-version: '3.11'
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}
permissions: read-all
jobs:
format-and-lint-checks:
name: File format & lint checks
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Check out a copy of the TFQ git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{env.python-version}}
cache: pip
cache-dependency-path: requirements.txt
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Check code formatting
run: ./scripts/format_check.sh
- name: Check code lint
run: ./scripts/lint_all.sh
wheel-build:
name: Wheel test
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Check out a copy of the TFQ git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{env.python-version}}
cache: pip
cache-dependency-path: requirements.txt
- 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
- name: Check out a copy of the TFQ git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{env.python-version}}
cache: pip
cache-dependency-path: requirements.txt
- 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
- name: Check out a copy of the TFQ git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{env.python-version}}
cache: pip
cache-dependency-path: requirements.txt
- name: Upgrade pip
run: pip install --upgrade pip
- 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