Skip to content

Commit

Permalink
Merge pull request #664 from microsoftgraph/ci/version-matrix
Browse files Browse the repository at this point in the history
ci: adds version matrix to ensure dependencies compatibility
  • Loading branch information
baywet authored Dec 4, 2024
2 parents 69f71ea + 58616ff commit bf376ea
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 47 deletions.
69 changes: 33 additions & 36 deletions .github/policies/msgraph-beta-sdk-python-branch-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,37 @@ description: Branch protection policy for the msgraph-beta-sdk-python repository
resource: repository
configuration:
branchProtectionRules:
- branchNamePattern: main
# This branch pattern applies to the following branches:
# main


- branchNamePattern: main
# This branch pattern applies to the following branches:
# main

# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# 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
requiredStatusChecks:
- CodeQL
- Validate code accuracy
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false

# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# 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
requiredStatusChecks:
- CodeQL
- check-build-matrix
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,34 @@ jobs:
validate:
name: Validate code accuracy
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with Pylint
run: pylint msgraph_beta --disable=W --rcfile=.pylintrc

# The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
check-build-matrix:
runs-on: ubuntu-latest
needs: validate
if: always()
steps:
- name: All build matrix options are successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
18 changes: 9 additions & 9 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aiohttp==3.11.9
aiohttp==3.10.11
aiosignal==1.3.1
anyio==4.6.2
astroid==3.3.5
astroid==3.2.4
async-timeout==5.0.1
attrs==24.2.0
azure-core==1.32.0
Expand All @@ -16,7 +16,7 @@ colorama==0.4.6
cryptography==44.0.0
Deprecated==1.2.15
dill==0.3.9
docutils==0.21.2
docutils==0.20.1
flit==3.10.1
flit_core==3.10.1
frozenlist==1.5.0
Expand Down Expand Up @@ -55,24 +55,24 @@ pendulum==3.0.0
platformdirs==4.3.6
portalocker==2.10.1
pycparser==2.22
PyJWT==2.10.1
pylint==3.3.2
PyJWT==2.9.0
pylint==3.2.6
pyproject_hooks==1.2.0
python-dateutil==2.9.0.post0
requests==2.32.3
six==1.16.0
sniffio==1.3.1
std-uritemplate==2.0.0
time-machine==2.16.0
time-machine==2.15.0
toml==0.10.2
tomli==2.2.1
tomli_w==1.1.0
tomli_w==1.0.0
tomlkit==0.13.2
typing_extensions==4.12.2
tzdata==2024.2
uritemplate==4.1.1
urllib3==2.2.3
wrapt==1.17.0
yapf==0.43.0
yarl==1.18.3
zipp==3.21.0
yarl==1.15.2
zipp==3.20.1

0 comments on commit bf376ea

Please sign in to comment.