Skip to content

Commit bb5ccda

Browse files
authored
Merge branch 'master' into mh-add-editorconfig
2 parents 6480d10 + 6b60bde commit bb5ccda

File tree

9 files changed

+331
-60
lines changed

9 files changed

+331
-60
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "yamllint",
5+
"pattern": [
6+
{
7+
"regexp": "^(.*\\.ya?ml)$",
8+
"file": 1
9+
},
10+
{
11+
"regexp": "^\\s{2}(\\d+):(\\d+)\\s+(error|warning)\\s+(.*?)\\s+\\((.*)\\)$",
12+
"line": 1,
13+
"column": 2,
14+
"severity": 3,
15+
"message": 4,
16+
"code": 5,
17+
"loop": true
18+
}
19+
]
20+
}
21+
]
22+
}

.github/workflows/ci-build-checks.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
Setup:
170170
if: needs.Decision.outputs.need_run == 'true'
171171
needs: Decision
172-
runs-on: ubuntu-20.04
172+
runs-on: ubuntu-22.04
173173
timeout-minutes: 15
174174
outputs:
175175
python_cache_key: ${{steps.parameters.outputs.python_cache_key}}
@@ -266,7 +266,7 @@ jobs:
266266
if: needs.Decision.outputs.need_run == 'true'
267267
name: Build Python wheel
268268
needs: [Decision, Setup]
269-
runs-on: ubuntu-20.04
269+
runs-on: ubuntu-22.04
270270
steps:
271271
- name: Check out a copy of the TFQ git repository
272272
uses: actions/checkout@v4
@@ -335,7 +335,7 @@ jobs:
335335
if: needs.Decision.outputs.need_run == 'true'
336336
name: Test the Python wheel
337337
needs: [Decision, Setup, Build_wheel]
338-
runs-on: ubuntu-20.04
338+
runs-on: ubuntu-22.04
339339
steps:
340340
- name: Check out a copy of the TFQ git repository
341341
uses: actions/checkout@v4
@@ -371,7 +371,7 @@ jobs:
371371
if: needs.Decision.outputs.need_run == 'true'
372372
name: Test the rest of TFQ
373373
needs: [Decision, Setup, Build_wheel]
374-
runs-on: ubuntu-20.04
374+
runs-on: ubuntu-22.04
375375
steps:
376376
- name: Check out a copy of the TFQ git repository
377377
uses: actions/checkout@v4
@@ -424,7 +424,7 @@ jobs:
424424
Tutorial_tests:
425425
if: needs.Decision.outputs.need_run == 'true'
426426
name: Test the tutorials
427-
runs-on: ubuntu-20.04
427+
runs-on: ubuntu-22.04
428428
needs: [Decision, Setup, Build_wheel]
429429
steps:
430430
- name: Check out a copy of the TFQ git repository
@@ -470,7 +470,7 @@ jobs:
470470
if: failure() || needs.setup.outputs.debug == 'true'
471471
name: Print debugging info
472472
needs: [Decision, Setup, Build_wheel, Bazel_tests]
473-
runs-on: ubuntu-20.04
473+
runs-on: ubuntu-22.04
474474
steps:
475475
- name: Check out a copy of the TFQ git repository
476476
uses: actions/checkout@v4

.github/workflows/ci-file-checks.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ jobs:
7979
python_files: ${{steps.filter.outputs.python_files}}
8080
cc: ${{steps.filter.outputs.cc}}
8181
cc_files: ${{steps.filter.outputs.cc_files}}
82+
yaml: ${{steps.filter.outputs.yaml}}
83+
yaml_files: ${{steps.filter.outputs.yaml_files}}
8284
steps:
8385
# When invoked manually, use the given SHA to figure out the change list.
8486
- if: github.event_name == 'workflow_dispatch'
@@ -125,6 +127,10 @@ jobs:
125127
- '**/*.cc'
126128
- '**/*.h'
127129
- '**/*.proto'
130+
yaml:
131+
- added|modified:
132+
- '**/*.yaml'
133+
- '**/*.yml'
128134
129135
Setup:
130136
if: needs.Changes.outputs.python == 'true'
@@ -336,3 +342,27 @@ jobs:
336342
} >> "$GITHUB_STEP_SUMMARY"
337343
fi
338344
exit $exit_code
345+
346+
Yaml-lint:
347+
if: needs.Changes.outputs.yaml == 'true'
348+
name: YAML lint
349+
needs: Changes
350+
runs-on: ubuntu-24.04
351+
steps:
352+
- name: Check out a copy of the TFQ git repository
353+
uses: actions/checkout@v4
354+
355+
- name: Set up yamllint output problem matcher
356+
run: echo '::add-matcher::.github/problem-matchers/yamllint.json'
357+
358+
- name: Find out the yamllint version
359+
id: yamllint
360+
run: |
361+
version=$(yamllint --version)
362+
echo "version=${version#yamllint }" >> "$GITHUB_OUTPUT"
363+
364+
- name: Run yamllint ${{steps.yamllint.outputs.version}}
365+
run: |
366+
set -x
367+
# shellcheck disable=SC2086
368+
yamllint --format github ${{needs.Changes.outputs.yaml_files}}

.github/workflows/ci-nightly-build-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: needs.Decision.outputs.run == 'true'
7777
name: Build and test
7878
needs: Decision
79-
runs-on: ubuntu-20.04
79+
runs-on: ubuntu-22.04
8080
steps:
8181
- name: Check out a copy of the TFQ git repository
8282
uses: actions/checkout@v4

.github/workflows/ci-nightly-cirq-test.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ on:
3333
type: string
3434
default: "x64"
3535

36-
use_bazel_disk_cache:
36+
use_disk_cache:
3737
description: Use Bazel disk_cache between runs
3838
type: boolean
3939
default: true
4040

41-
cache_bazel_tests:
41+
use_test_cache:
4242
description: Allow Bazel to cache test results
4343
type: boolean
4444
default: true
@@ -72,7 +72,7 @@ concurrency:
7272
jobs:
7373
test-compatibility:
7474
name: Run TFQ tests
75-
runs-on: ubuntu-20.04
75+
runs-on: ubuntu-22.04
7676
steps:
7777
- name: Check out a copy of the TFQ git repository
7878
uses: actions/checkout@v4
@@ -92,27 +92,29 @@ jobs:
9292
9393
- name: Install the nightly build version of Cirq
9494
run: |
95+
echo 'numpy<2.0.0' > constraint.txt
96+
export PIP_CONSTRAINT=constraint.txt
9597
pip install -U cirq --pre
9698
9799
- name: Configure Bazel options
98100
run: |
99101
# If we didn't get a cache hit on the installed Python environment,
100102
# something's changed, and we want to make sure to re-run all tests.
101103
if [[ "${{steps.python.outputs.cache-hit}}" == "true"
102-
&& "${{github.event.inputs.cache_bazel_tests}}" != "false" ]]; then
103-
echo "cache_bazel_tests=auto" >> "$GITHUB_ENV"
104+
&& "${{github.event.inputs.use_test_cache}}" != "false" ]]; then
105+
echo "use_test_cache=auto" >> "$GITHUB_ENV"
104106
else
105-
echo "cache_bazel_tests=no" >> "$GITHUB_ENV"
107+
echo "use_test_cache=no" >> "$GITHUB_ENV"
106108
fi
107109
# Use the disk cache unless told not to.
108-
if [[ "${{github.event.inputs.use_bazel_disk_cache}}" != "false" ]]; then
109-
echo "use_bazel_disk_cache=true" >> "$GITHUB_ENV"
110+
if [[ "${{github.event.inputs.use_disk_cache}}" != "false" ]]; then
111+
echo "use_disk_cache=true" >> "$GITHUB_ENV"
110112
else
111-
echo "use_bazel_disk_cache=false" >> "$GITHUB_ENV"
113+
echo "use_disk_cache=false" >> "$GITHUB_ENV"
112114
fi
113115
114116
- name: Set up Bazel with caching
115-
if: env.use_bazel_disk_cache == 'true'
117+
if: env.use_disk_cache == 'true'
116118
uses: bazel-contrib/[email protected]
117119
env:
118120
USE_BAZEL_VERSION: ${{inputs.bazel_version || env.bazel_version}}
@@ -123,17 +125,17 @@ jobs:
123125
repository-cache: true
124126
bazelrc: |
125127
${{env.bazelrc_additions}}
126-
test --cache_test_results=${{env.cache_bazel_tests}}
128+
test --cache_test_results=${{env.use_test_cache}}
127129
128130
- name: Set up Bazel without caching
129-
if: env.use_bazel_disk_cache == 'false'
131+
if: env.use_disk_cache == 'false'
130132
uses: bazel-contrib/[email protected]
131133
env:
132134
USE_BAZEL_VERSION: ${{inputs.bazel_version || env.bazel_version}}
133135
with:
134136
bazelrc: |
135137
${{env.bazelrc_additions}}
136-
test --cache_test_results=${{env.cache_bazel_tests}}
138+
test --cache_test_results=${{env.use_test_cache}}
137139
138140
- name: Configure TFQ
139141
run: |

.yamllint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Summary: yamllint configuration for TensorFlow Quantum.
2+
# See https://yamllint.readthedocs.io/ for info about configuration options.
3+
4+
rules:
5+
line-length:
6+
# A common occurrence in YAML files is long URLs. The next two settings are
7+
# not specific to URLs, but help. It saves developer time by not requiring
8+
# comment directives to disable warnings at every occurrence.
9+
allow-non-breakable-words: true
10+
allow-non-breakable-inline-mappings: true

0 commit comments

Comments
 (0)