Skip to content

Commit b12d753

Browse files
authored
Merge pull request #224 from mhucka/mh-ci-pin-versions
Pin versions & make other changes to CI workflows for best practices
2 parents 1677b94 + fc95583 commit b12d753

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

.github/workflows/black.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
name: Lint
1+
name: Python formatting
22

33
on: [push, pull_request]
44

5+
# Declare default permissions as read only.
6+
permissions: read-all
7+
58
jobs:
69
lint:
7-
runs-on: ubuntu-latest
10+
name: Run black
11+
runs-on: ubuntu-24.04
12+
timeout-minutes: 10
813
steps:
9-
- uses: actions/checkout@v4
10-
- uses: psf/black@stable
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
- uses: psf/black@8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # stable
1116
with:
1217
src: "./unitary"

.github/workflows/pylint.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ name: Pylint
22

33
on: [push, pull_request]
44

5+
# Declare default permissions as read only.
6+
permissions: read-all
7+
58
jobs:
69
pylint:
7-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
11+
timeout-minutes: 10
812
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-python@v5
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
1115
with:
1216
python-version: '3.12'
1317
architecture: 'x64'

.github/workflows/pythonpackage.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,30 @@
1313
# limitations under the License.
1414

1515
name: Python package
16+
1617
on:
1718
push:
1819
branches: [ main ]
1920
pull_request:
2021
branches: [ main ]
2122

23+
# Declare default permissions as read only.
24+
permissions: read-all
25+
2226
jobs:
2327
pytest:
2428
name: Pytest
25-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04
30+
timeout-minutes: 15
2631
strategy:
2732
matrix:
2833
cirq-version:
2934
- 'current'
3035
- 'next'
3136
fail-fast: false
3237
steps:
33-
- uses: actions/checkout@v4
34-
- uses: actions/setup-python@v5
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
39+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
3540
with:
3641
python-version: '3.12'
3742
- name: Install dependencies
@@ -57,10 +62,11 @@ jobs:
5762
UNITARY_CHESS_TEST_SEED=789 UNITARY_IMPORT_FAILSAFE=y pytest -v
5863
nbformat:
5964
name: Notebook formatting
60-
runs-on: ubuntu-latest
65+
runs-on: ubuntu-24.04
66+
timeout-minutes: 15
6167
steps:
62-
- uses: actions/checkout@v4
63-
- uses: actions/setup-python@v5
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
69+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
6470
with:
6571
python-version: '3.12'
6672
- name: Doc check

0 commit comments

Comments
 (0)