Skip to content

Commit b785976

Browse files
authored
Merge branch 'main' into patch-1
2 parents e6fb999 + fc1cc5f commit b785976

File tree

6 files changed

+100
-104
lines changed

6 files changed

+100
-104
lines changed

.github/actionlint.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# Summary: configure actionlint (https://github.com/rhysd/actionlint).
16+
1517
self-hosted-runner:
16-
# We don't have self-hosted runners, but we do use some of the "partner"
17-
# runner images at https://github.com/actions/partner-runner-images
18+
# We use some custom runners and also some GitHub runners from
19+
# https://github.com/actions/partner-runner-images
1820
labels:
1921
- ubuntu-24.04-arm
22+
- ubuntu-slim
23+
- ubuntu-24.04-x64-8-core

.github/workflows/ci.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
echo base=${{github.ref_name}} >> "$GITHUB_ENV"
150150
151151
- name: Check out a copy of the OpenFermion git repository
152-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
152+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
153153

154154
- name: Determine files changed by this ${{github.event_name}} event
155155
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
@@ -199,7 +199,7 @@ jobs:
199199
timeout-minutes: 10
200200
steps:
201201
- name: Check out a copy of the git repository
202-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
202+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
203203

204204
- name: Set up Python with caching of pip dependencies
205205
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -228,7 +228,7 @@ jobs:
228228
timeout-minutes: 10
229229
steps:
230230
- name: Check out a copy of the git repository
231-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
231+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
232232
with:
233233
fetch-depth: 0
234234

@@ -257,7 +257,7 @@ jobs:
257257
timeout-minutes: 10
258258
steps:
259259
- name: Check out a copy of the git repository
260-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
260+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
261261

262262
- name: Set up Python and restore cache
263263
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -284,7 +284,7 @@ jobs:
284284
timeout-minutes: 10
285285
steps:
286286
- name: Check out a copy of the git repository
287-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
287+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
288288

289289
- name: Set up Python and restore cache
290290
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -324,7 +324,7 @@ jobs:
324324
fail-fast: false
325325
steps:
326326
- name: Check out a copy of the git repository
327-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
327+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
328328

329329
- name: Set up Python and restore cache
330330
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -371,7 +371,7 @@ jobs:
371371
fail-fast: false
372372
steps:
373373
- name: Check out a copy of the git repository
374-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
374+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
375375

376376
- name: Set up Python and restore cache
377377
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -413,7 +413,7 @@ jobs:
413413
timeout-minutes: 15
414414
steps:
415415
- name: Check out a copy of the git repository
416-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
416+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
417417

418418
# Note: deliberately not using our Python cache here b/c this runs
419419
# a different version of Python.
@@ -439,7 +439,7 @@ jobs:
439439
timeout-minutes: 15
440440
steps:
441441
- name: Check out a copy of the git repository
442-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
442+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
443443
with:
444444
fetch-depth: 0
445445

@@ -469,7 +469,7 @@ jobs:
469469
changed_files: ${{needs.changes.outputs.yaml_files}}
470470
steps:
471471
- name: Check out a copy of the git repository
472-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
472+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
473473

474474
- name: Set up yamllint output problem matcher
475475
run: echo "::add-matcher::.github/problem-matchers/yamllint.json"
@@ -490,7 +490,7 @@ jobs:
490490
changed_files: ${{needs.changes.outputs.json_files}}
491491
steps:
492492
- name: Check out a copy of the git repository
493-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
493+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
494494

495495
- name: Install jsonlint
496496
run: npm install -g @prantlf/jsonlint
@@ -511,7 +511,7 @@ jobs:
511511
changed_files: ${{needs.changes.outputs.cff_files}}
512512
steps:
513513
- name: Check out a copy of the git repository
514-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
514+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
515515

516516
- name: Install cffconvert
517517
run: pip install cffconvert
@@ -530,7 +530,7 @@ jobs:
530530
changed_files: ${{needs.changes.outputs.docker_files}}
531531
steps:
532532
- name: Check out a copy of the git repository
533-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
533+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
534534

535535
# Note: there is a hadolint GitHub Actions available, but it only accepts
536536
# one Dockerfile to check. We have > 1 file to check, so we need the CLI.
@@ -554,7 +554,7 @@ jobs:
554554
changed_files: ${{needs.changes.outputs.gha_files}}
555555
steps:
556556
- name: Check out a copy of the git repository
557-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
557+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
558558

559559
# The next action simply fails if there are any unpinned actions.
560560
- name: Verify that all workflow actions have pinned versions
@@ -580,7 +580,7 @@ jobs:
580580
changed_files: ${{needs.changes.outputs.shell_files}}
581581
steps:
582582
- name: Check out a copy of the git repository
583-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
583+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
584584

585585
- name: Set up shellcheck output problem matcher
586586
run: echo "::add-matcher::.github/problem-matchers/shellcheck.json"
@@ -604,7 +604,7 @@ jobs:
604604
timeout-minutes: 5
605605
steps:
606606
- name: Check out a copy of the git repository
607-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
607+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
608608

609609
- name: Set up Python with caching of pip dependencies
610610
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0

.github/workflows/nightly-pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
steps:
7676
- name: Check out a copy of the OpenFermion git repository
77-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
77+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
7878

7979
- name: Set up Python ${{matrix.python-version}}
8080
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5

.github/workflows/osv-scanner.yaml

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,26 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16-
# Zero-config modular workflow to run Open Source Vulnerabilities code scans.
17-
#
15+
name: OSV scan
16+
run-name: Run open-source vulnerabilities (OSV) scanner
17+
1818
# The OSV scanner is a dependency vulnerability scanner that identifies known
1919
# vulnerabilities in a project's dependencies. It supports C/C++, Python, Java,
2020
# JavaScript, and others. The findings are reported in the repo's code-scanning
2121
# results page, https://github.com/quantumlib/REPO/security/code-scanning/.
22-
#
23-
# Note: the OSV project provides a workflow you can reference as a step with
24-
# uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml.
25-
# Unfortunately, that workflow hardcodes some behaviors (such as uploading the
26-
# SARIF file to the workflow Actions tab, which we have never needed). The
27-
# workflow in this file is basically a heavily modified version of theirs.
28-
#
2922
# For more OSV scanner examples and options, including how to ignore specific
3023
# vulnerabilities, see https://google.github.io/osv-scanner/github-action/.
31-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
33-
name: OSV known vulnerabilities scanner
34-
run-name: Run OSV (open-source vulnerabilities) scanner ${{inputs.reason}}
3524

3625
on:
26+
schedule:
27+
# Run weekly on Saturdays.
28+
- cron: '30 10 * * 6'
29+
3730
pull_request:
3831
types: [opened, synchronize]
3932
branches:
4033
- main
4134

42-
# Support merge queues.
43-
merge_group:
44-
types:
45-
- checks_requested
46-
47-
# Allow calling from other workflows.
48-
workflow_call:
49-
inputs:
50-
reason:
51-
description: 'Append text to workflow run name:'
52-
type: string
53-
debug:
54-
description: 'Run with debugging options'
55-
type: boolean
56-
default: false
57-
5835
# Allow manual invocation.
5936
workflow_dispatch:
6037
inputs:
@@ -63,33 +40,29 @@ on:
6340
type: boolean
6441
default: true
6542

66-
# Declare default workflow permissions as read only.
67-
permissions: read-all
68-
6943
concurrency:
7044
# Cancel any previously-started but still active runs on the same branch.
7145
cancel-in-progress: true
7246
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}
7347

48+
# Declare default workflow permissions as read only.
49+
permissions: read-all
50+
7451
jobs:
7552
osv-scan:
7653
if: github.repository_owner == 'quantumlib'
77-
name: Run OSV scanner
54+
name: OSV scanner
7855
runs-on: ubuntu-24.04
79-
timeout-minutes: 15
56+
timeout-minutes: 30
8057
permissions:
81-
# Needed to read commit contents:
82-
actions: read
8358
# Needed to upload the results to code-scanning dashboard:
8459
security-events: write
85-
# Needed to upload SARIF file to CodeQL.
86-
contents: read
8760
env:
8861
# Setting Bash SHELLOPTS here takes effect for all shell commands below.
8962
SHELLOPTS: ${{inputs.debug && 'xtrace' || '' }}
9063
steps:
9164
- name: Check out a copy of the git repository
92-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
65+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
9366
with:
9467
fetch-depth: 0
9568

@@ -100,7 +73,7 @@ jobs:
10073
10174
- name: Run OSV scanner on existing code
10275
# yamllint disable rule:line-length
103-
uses: google/osv-scanner-action/osv-scanner-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
76+
uses: google/osv-scanner-action/osv-scanner-action@b77c075a1235514558f0eb88dbd31e22c45e0cd2 # v2.3.0
10477
continue-on-error: true
10578
with:
10679
scan-args: |-
@@ -118,7 +91,7 @@ jobs:
11891
11992
- name: Run OSV scanner on new code
12093
# yamllint disable rule:line-length
121-
uses: google/osv-scanner-action/osv-scanner-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
94+
uses: google/osv-scanner-action/osv-scanner-action@b77c075a1235514558f0eb88dbd31e22c45e0cd2 # v2.3.0
12295
continue-on-error: true
12396
with:
12497
scan-args: |-
@@ -128,9 +101,22 @@ jobs:
128101
--recursive
129102
./
130103
131-
- name: Run the OSV scanner reporter
104+
- name: Run the OSV scanner reporter for the job summary page
105+
# yamllint disable rule:line-length
106+
uses: google/osv-scanner-action/osv-reporter-action@b77c075a1235514558f0eb88dbd31e22c45e0cd2 # v2.3.0
107+
with:
108+
scan-args: |-
109+
--output=markdown:output.md
110+
--old=old-results.json
111+
--new=new-results.json
112+
--fail-on-vuln=false
113+
114+
- name: Write the results to the job summary page
115+
run: cat output.md >> "$GITHUB_STEP_SUMMARY"
116+
117+
- name: Run the OSV scanner reporter for the code-scanning dashboard
132118
# yamllint disable rule:line-length
133-
uses: google/osv-scanner-action/osv-reporter-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
119+
uses: google/osv-scanner-action/osv-reporter-action@b77c075a1235514558f0eb88dbd31e22c45e0cd2 # v2.3.0
134120
with:
135121
scan-args: |-
136122
--output=osv-results.sarif
@@ -139,21 +125,21 @@ jobs:
139125
--gh-annotations=true
140126
--fail-on-vuln=true
141127
142-
- name: Upload results to the repository's code-scanning results dashboard
128+
- name: Upload results to the code-scanning results dashboard
143129
id: upload_artifact
144130
# yamllint disable rule:line-length
145-
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
131+
uses: github/codeql-action/upload-sarif@ba454b8ab46733eb6145342877cd148270bb77ab # codeql-bundle-v2.23.5
146132
with:
147133
sarif_file: osv-results.sarif
148134

149-
- if: github.event.inputs.debug == true
135+
- if: github.event.inputs.debug == true || runner.debug == true
150136
name: Upload results as artifacts to the workflow Summary page
151-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v4
137+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
152138
with:
153139
name: SARIF file
154-
path: results.sarif
140+
path: osv-results.sarif
155141
retention-days: 5
156142

157-
- name: Error troubleshooter
143+
- name: Print an alert message if an error occurred
158144
if: ${{always() && steps.upload_artifact.outcome == 'failure'}}
159145
run: echo '::error::Artifact upload failed. Check the workflow logs.'

0 commit comments

Comments
 (0)