-
Notifications
You must be signed in to change notification settings - Fork 39
chore(CI): migrate CB CI jobs to GHA #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b6c4d62
chore(CI): migrate CB CI jobs to GHA
josecorella e32cb17
add creds
josecorella ccbd478
more
josecorella 5a94a41
more
josecorella ef4754c
more
josecorella 60f9472
more
josecorella 33157e2
m
josecorella 8a89f6b
m
josecorella c5cf1f9
m
josecorella c89b599
more
josecorella acab33f
m
josecorella 492566b
m
josecorella 6f6937c
m
josecorella 79ddcbd
m
josecorella 21c09be
m
josecorella 990ec56
m
josecorella 409ad23
whoopsie made an oopsie
josecorella 212a64b
another
josecorella 1c15271
m
josecorella ccf4b59
lil comment
josecorella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ name: static analysis | |
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ master ] | ||
| push: | ||
| # Run once a day | ||
| schedule: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Python Examples Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| examples: | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
| include: | ||
| - python-version: '3.8' | ||
| tox-env: 'py38-examples' | ||
| - python-version: '3.9' | ||
| tox-env: 'py39-examples' | ||
| - python-version: '3.10' | ||
| tox-env: 'py310-examples' | ||
| - python-version: '3.11' | ||
| tox-env: 'py311-examples' | ||
| - python-version: '3.12' | ||
| tox-env: 'py312-examples' | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| env: | ||
| TOXENV: ${{ matrix.tox-env }} | ||
| AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- | ||
| arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f | ||
| AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- | ||
| arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 | ||
| AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- | ||
| arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Configure AWS Credentials for Tests | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: us-west-2 | ||
| role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-ESDK-CLI-Role-us-west-2 | ||
| role-session-name: CLITests | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install "tox < 4.0" | ||
|
|
||
| # Python no longer bundles setuptools starting in 3.12 | ||
| - name: Install python version specific dependencies | ||
| if: matrix.python-version == '3.12' | ||
| run: | | ||
| pip install -r dev_requirements/ci-requirements.txt | ||
|
|
||
| - name: Run examples tests with tox | ||
| run: tox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Python Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| integration: | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
| include: | ||
| - python-version: '3.8' | ||
| tox-env: 'py38-integ' | ||
| - python-version: '3.9' | ||
| tox-env: 'py39-integ' | ||
| - python-version: '3.10' | ||
| tox-env: 'py310-integ' | ||
| - python-version: '3.11' | ||
| tox-env: 'py311-integ' | ||
| - python-version: '3.12' | ||
| tox-env: 'py312-integ' | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| env: | ||
| TOXENV: ${{ matrix.tox-env }} | ||
| AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- | ||
| arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f | ||
| AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- | ||
| arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Configure AWS Credentials for Tests | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: us-west-2 | ||
| role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-ESDK-CLI-Role-us-west-2 | ||
| role-session-name: CLITests | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install "tox < 4.0" | ||
|
|
||
| # Python no longer bundles setuptools starting in 3.12 | ||
| - name: Install python version specific dependencies | ||
| if: matrix.python-version == '3.12' | ||
| run: | | ||
| pip install -r dev_requirements/ci-requirements.txt | ||
|
|
||
| - name: Run integration tests with tox | ||
| run: tox | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| AWSTemplateFormatVersion: "2010-09-09" | ||
| Description: "DDB Table and IAM Managed Policies/Role for AWS KMS Hierarchical Keyring Testing" | ||
|
|
||
| Parameters: | ||
| ProjectName: | ||
| Type: String | ||
| Description: A prefix that will be applied to any names | ||
| Default: ESDK-CLI | ||
| GitHubRepo: | ||
| Type: String | ||
| Description: GitHub Repo that invokes CI | ||
| Default: aws/aws-encryption-sdk-cli | ||
|
|
||
| Resources: | ||
| GitHubCIRole: | ||
| Type: 'AWS::IAM::Role' | ||
| Properties: | ||
| RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}" | ||
| Description: "Access KMS Resources for CI from GitHub" | ||
| ManagedPolicyArns: | ||
| - "arn:aws:iam::370957321024:policy/KMS-Public-CMK-EncryptDecrypt-Key-Access" | ||
| AssumeRolePolicyDocument: !Sub | | ||
| { | ||
| "Version": "2012-10-17", | ||
| "Statement": [ | ||
| { | ||
| "Effect": "Allow", | ||
| "Principal": { "Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com" }, | ||
| "Action": "sts:AssumeRoleWithWebIdentity", | ||
| "Condition": { | ||
| "StringEquals": { | ||
| "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" | ||
| }, | ||
| "StringLike": { | ||
| "token.actions.githubusercontent.com:sub": "repo:${GitHubRepo}:*" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "AWS": "*" | ||
| }, | ||
| "Action": "sts:AssumeRole", | ||
| "Condition": { | ||
| "StringEquals": { | ||
| "aws:PrincipalArn": [ | ||
| "arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand this one -- why just 3.12?
Ditto in the examples file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason it installs these in the cb job, since python 3.12 requires setuptools and the other versions dont
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Thanks, I remember this now.
Could you make a comment just above this saying something like
just so we know we'll have to bump this once we add 3.13 support.
Ideally we'd write
but I don't think that works