Skip to content

Commit bf376ea

Browse files
authored
Merge pull request #664 from microsoftgraph/ci/version-matrix
ci: adds version matrix to ensure dependencies compatibility
2 parents 69f71ea + 58616ff commit bf376ea

File tree

3 files changed

+62
-47
lines changed

3 files changed

+62
-47
lines changed

.github/policies/msgraph-beta-sdk-python-branch-protection.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,37 @@ description: Branch protection policy for the msgraph-beta-sdk-python repository
88
resource: repository
99
configuration:
1010
branchProtectionRules:
11+
- branchNamePattern: main
12+
# This branch pattern applies to the following branches:
13+
# main
1114

12-
13-
- branchNamePattern: main
14-
# This branch pattern applies to the following branches:
15-
# main
16-
17-
# Specifies whether this branch can be deleted. boolean
18-
allowsDeletions: false
19-
# Specifies whether forced pushes are allowed on this branch. boolean
20-
allowsForcePushes: false
21-
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
22-
dismissStaleReviews: true
23-
# Specifies whether admins can overwrite branch protection. boolean
24-
isAdminEnforced: false
25-
# Indicates whether "Require a pull request before merging" is enabled. boolean
26-
requiresPullRequestBeforeMerging: true
27-
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
28-
requiredApprovingReviewsCount: 1
29-
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
30-
requireCodeOwnersReview: true
31-
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
32-
requiresCommitSignatures: false
33-
# Are conversations required to be resolved before merging? boolean
34-
requiresConversationResolution: true
35-
# Are merge commits prohibited from being pushed to this branch. boolean
36-
requiresLinearHistory: false
37-
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
38-
requiredStatusChecks:
39-
- CodeQL
40-
- Validate code accuracy
41-
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
42-
requiresStrictStatusChecks: true
43-
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
44-
restrictsPushes: false
45-
# Restrict who can dismiss pull request reviews. boolean
46-
restrictsReviewDismissals: false
47-
15+
# Specifies whether this branch can be deleted. boolean
16+
allowsDeletions: false
17+
# Specifies whether forced pushes are allowed on this branch. boolean
18+
allowsForcePushes: false
19+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
20+
dismissStaleReviews: true
21+
# Specifies whether admins can overwrite branch protection. boolean
22+
isAdminEnforced: false
23+
# Indicates whether "Require a pull request before merging" is enabled. boolean
24+
requiresPullRequestBeforeMerging: true
25+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
26+
requiredApprovingReviewsCount: 1
27+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
28+
requireCodeOwnersReview: true
29+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
30+
requiresCommitSignatures: false
31+
# Are conversations required to be resolved before merging? boolean
32+
requiresConversationResolution: true
33+
# Are merge commits prohibited from being pushed to this branch. boolean
34+
requiresLinearHistory: false
35+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
36+
requiredStatusChecks:
37+
- CodeQL
38+
- check-build-matrix
39+
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
40+
requiresStrictStatusChecks: true
41+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
42+
restrictsPushes: false
43+
# Restrict who can dismiss pull request reviews. boolean
44+
restrictsReviewDismissals: false

.github/workflows/build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,34 @@ jobs:
1212
validate:
1313
name: Validate code accuracy
1414
runs-on: ubuntu-latest
15+
strategy:
16+
max-parallel: 5
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1519
steps:
1620
- uses: actions/checkout@v4
17-
- name: Set up Python
21+
- name: Set up Python ${{ matrix.python-version }}
1822
uses: actions/setup-python@v5
1923
with:
20-
python-version: '3.12'
24+
python-version: ${{ matrix.python-version }}
2125
- name: Install dependencies
2226
run: |
2327
python -m pip install --upgrade pip
2428
pip install -r requirements-dev.txt
2529
2630
- name: Lint with Pylint
2731
run: pylint msgraph_beta --disable=W --rcfile=.pylintrc
32+
33+
# The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
34+
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
35+
check-build-matrix:
36+
runs-on: ubuntu-latest
37+
needs: validate
38+
if: always()
39+
steps:
40+
- name: All build matrix options are successful
41+
if: ${{ !(contains(needs.*.result, 'failure')) }}
42+
run: exit 0
43+
- name: One or more build matrix options failed
44+
if: ${{ contains(needs.*.result, 'failure') }}
45+
run: exit 1

requirements-dev.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
aiohttp==3.11.9
1+
aiohttp==3.10.11
22
aiosignal==1.3.1
33
anyio==4.6.2
4-
astroid==3.3.5
4+
astroid==3.2.4
55
async-timeout==5.0.1
66
attrs==24.2.0
77
azure-core==1.32.0
@@ -16,7 +16,7 @@ colorama==0.4.6
1616
cryptography==44.0.0
1717
Deprecated==1.2.15
1818
dill==0.3.9
19-
docutils==0.21.2
19+
docutils==0.20.1
2020
flit==3.10.1
2121
flit_core==3.10.1
2222
frozenlist==1.5.0
@@ -55,24 +55,24 @@ pendulum==3.0.0
5555
platformdirs==4.3.6
5656
portalocker==2.10.1
5757
pycparser==2.22
58-
PyJWT==2.10.1
59-
pylint==3.3.2
58+
PyJWT==2.9.0
59+
pylint==3.2.6
6060
pyproject_hooks==1.2.0
6161
python-dateutil==2.9.0.post0
6262
requests==2.32.3
6363
six==1.16.0
6464
sniffio==1.3.1
6565
std-uritemplate==2.0.0
66-
time-machine==2.16.0
66+
time-machine==2.15.0
6767
toml==0.10.2
6868
tomli==2.2.1
69-
tomli_w==1.1.0
69+
tomli_w==1.0.0
7070
tomlkit==0.13.2
7171
typing_extensions==4.12.2
7272
tzdata==2024.2
7373
uritemplate==4.1.1
7474
urllib3==2.2.3
7575
wrapt==1.17.0
7676
yapf==0.43.0
77-
yarl==1.18.3
78-
zipp==3.21.0
77+
yarl==1.15.2
78+
zipp==3.20.1

0 commit comments

Comments
 (0)