Skip to content

Commit 8661d12

Browse files
authored
Run tests on latest and lowest typing-extensions (#4)
Also fix coverage workflow
1 parent 7a5f7c1 commit 8661d12

File tree

2 files changed

+69
-5
lines changed

2 files changed

+69
-5
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Post coverage comment
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
test:
11+
name: Run tests & display coverage
12+
runs-on: ubuntu-latest
13+
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
14+
permissions:
15+
# Gives the action the necessary permissions for publishing new
16+
# comments in pull requests.
17+
pull-requests: write
18+
# Gives the action the necessary permissions for editing existing
19+
# comments (to avoid publishing multiple comments in the same PR)
20+
contents: write
21+
# Gives the action the necessary permissions for looking up the
22+
# workflow that launched this workflow, and download the related
23+
# artifact that contains the comment to be published
24+
actions: read
25+
steps:
26+
# DO NOT run actions/checkout here, for security reasons
27+
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
28+
- name: Post comment
29+
uses: py-cov-action/python-coverage-comment-action@v3
30+
with:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}

.github/workflows/tests.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
name: Tests
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '**'
9+
pull_request:
10+
11+
env:
12+
FORCE_COLOR: 1
413

514
jobs:
615
test:
7-
name: Run tests with pytest
16+
name: Run tests
817
strategy:
918
fail-fast: false
1019
matrix:
11-
os: [ubuntu-latest, macos-latest, windows-latest]
1220
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
21+
os: [ubuntu-latest, macos-latest, windows-latest]
1322
runs-on: ${{ matrix.os }}
1423
steps:
1524
- uses: actions/checkout@v4
@@ -32,6 +41,31 @@ jobs:
3241
path: coverage
3342
include-hidden-files: true
3443

44+
test-typing-extensions:
45+
name: Run test on typing-extensions
46+
runs-on: ubuntu-latest
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
typing-extensions: [main, lowest]
51+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: astral-sh/setup-uv@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
- name: Install dependencies and typing-extensions main
59+
run: |
60+
uv sync --group tests
61+
uv pip install 'typing-extensions @ git+https://github.com/python/typing_extensions.git'
62+
if: matrix.typing-extensions == 'main'
63+
- name: Install lowest dependencies
64+
run: uv sync --group tests --resolution lowest-direct
65+
if: matrix.typing-extensions == 'lowest'
66+
- name: Run tests
67+
run: make test
68+
3569
docs:
3670
name: Build and check documentation
3771
runs-on: ubuntu-latest
@@ -103,8 +137,6 @@ jobs:
103137

104138
steps:
105139
- uses: actions/checkout@v4
106-
with:
107-
persist-credentials: false
108140

109141
- name: Download coverage data
110142
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)