Skip to content

Commit 289e5d3

Browse files
authored
Simplify some GitHub workflows (#15940)
1 parent 948aeb8 commit 289e5d3

4 files changed

Lines changed: 41 additions & 38 deletions

File tree

.github/workflows/daily.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,14 @@ jobs:
123123
with:
124124
repository: typeshed-internal/stub_uploader
125125
path: stub_uploader
126-
- uses: actions/setup-python@v6
127-
with:
128-
# Keep in sync with stub_uploader's check_scripts.yml workflow.
129-
python-version: "3.13"
130126
- uses: astral-sh/setup-uv@v7
131127
with:
132128
version-file: "typeshed/requirements-tests.txt"
133129
- name: Run tests
134130
run: |
135131
cd stub_uploader
136-
uv pip install -r requirements.txt --system
137-
python -m pytest tests
132+
# Keep Python version in sync with stub_uploader's check_scripts.yml workflow.
133+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests
138134
139135
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
140136
create-issue-on-failure:

.github/workflows/meta_tests.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ jobs:
3636
fail-fast: false
3737
steps:
3838
- uses: actions/checkout@v6
39-
- uses: actions/setup-python@v6
40-
with:
41-
python-version: "3.13"
4239
- uses: astral-sh/setup-uv@v7
4340
with:
4441
version-file: "requirements-tests.txt"
45-
- run: uv pip install -r requirements-tests.txt --system
46-
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
42+
- run: |
43+
uv run \
44+
--python=3.13 \
45+
--no-project \
46+
--with-requirements=requirements-tests.txt \
47+
./tests/typecheck_typeshed.py \
48+
--platform=${{ matrix.platform }}
49+
4750
pyright:
4851
name: Check scripts and tests with pyright
4952
runs-on: ubuntu-latest
@@ -67,20 +70,23 @@ jobs:
6770
python-platform: ${{ matrix.python-platform }}
6871
python-version: "3.10" # Oldest version supported for running scripts and tests
6972
project: ./pyrightconfig.scripts_and_tests.json
73+
7074
stubsabot-dry-run:
7175
name: Stubsabot dry run
7276
runs-on: ubuntu-latest
7377
steps:
7478
- uses: actions/checkout@v6
75-
- uses: actions/setup-python@v6
76-
with:
77-
python-version: "3.13"
7879
- uses: astral-sh/setup-uv@v7
7980
with:
8081
version-file: "requirements-tests.txt"
8182
- name: Git config
8283
run: |
8384
git config --global user.name stubsabot
8485
git config --global user.email '<>'
85-
- run: uv pip install -r requirements-tests.txt --system
86-
- run: python scripts/stubsabot.py --action-level local
86+
- run: |
87+
uv run \
88+
--python=3.13 \
89+
--no-project \
90+
--with-requirements=requirements-tests.txt \
91+
scripts/stubsabot.py \
92+
--action-level=local

.github/workflows/stubsabot.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,22 @@ jobs:
2424
# use an ssh key so that checks automatically run on stubsabot PRs
2525
ssh-key: ${{ secrets.STUBSABOT_SSH_PRIVATE_KEY }}
2626
fetch-depth: 0
27-
- uses: actions/setup-python@v6
28-
with:
29-
python-version: "3.13"
3027
- uses: astral-sh/setup-uv@v7
3128
with:
3229
version-file: "requirements-tests.txt"
3330
- name: git config
3431
run: |
3532
git config --global user.name stubsabot
3633
git config --global user.email '<>'
37-
- name: Install dependencies
38-
run: uv pip install -r requirements-tests.txt --system
3934
- name: Run stubsabot
40-
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/stubsabot.py --action-level everything
35+
run: |
36+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
37+
uv run \
38+
--python=3.13 \
39+
--no-project \
40+
--with-requirements=requirements-tests.txt \
41+
scripts/stubsabot.py \
42+
--action-level=everything
4143
4244
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
4345
create-issue-on-failure:

.github/workflows/tests.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v6
30-
- uses: actions/setup-python@v6
31-
with:
32-
python-version: "3.13"
3330
- uses: astral-sh/setup-uv@v7
3431
with:
3532
version-file: "requirements-tests.txt"
36-
- run: uv pip install -r requirements-tests.txt --system
37-
- run: python ./tests/check_typeshed_structure.py
33+
- run: |
34+
uv run \
35+
--python=3.13 \
36+
--no-project \
37+
--with-requirements=requirements-tests.txt \
38+
./tests/check_typeshed_structure.py
3839
3940
mypy:
4041
name: "mypy: Check stubs"
@@ -69,14 +70,17 @@ jobs:
6970
runs-on: ubuntu-latest
7071
steps:
7172
- uses: actions/checkout@v6
72-
- uses: actions/setup-python@v6
73-
with:
74-
python-version: "3.14"
7573
- uses: astral-sh/setup-uv@v7
7674
with:
7775
version-file: "requirements-tests.txt"
78-
- run: uv pip install -r requirements-tests.txt --system
79-
- run: python ./tests/regr_test.py --all --verbosity QUIET
76+
- run: |
77+
uv run \
78+
--python=3.14 \
79+
--no-project \
80+
--with-requirements=requirements-tests.txt \
81+
./tests/regr_test.py \
82+
--all \
83+
--verbosity=QUIET
8084
8185
pyright:
8286
name: "pyright: Run test cases"
@@ -156,15 +160,10 @@ jobs:
156160
with:
157161
repository: typeshed-internal/stub_uploader
158162
path: stub_uploader
159-
- uses: actions/setup-python@v6
160-
with:
161-
# Keep in sync with stub_uploader's check_scripts.yml workflow.
162-
python-version: "3.13"
163163
- uses: astral-sh/setup-uv@v7
164164
with:
165165
version-file: "typeshed/requirements-tests.txt"
166166
- name: Run tests
167167
run: |
168168
cd stub_uploader
169-
uv pip install -r requirements.txt --system
170-
python -m pytest tests
169+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests

0 commit comments

Comments
 (0)