-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f7e715
commit cfb2f7e
Showing
226 changed files
with
64,994 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,92 @@ | ||
# This workflow performs tests in Python. | ||
name: Library Python tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
dafny: | ||
description: "The Dafny version to run" | ||
required: true | ||
type: string | ||
regenerate-code: | ||
description: "Regenerate code using smithy-dafny" | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
testPython: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
library: | ||
[ | ||
StandardLibrary, | ||
AwsCryptographyPrimitives, | ||
ComAmazonawsKms, | ||
ComAmazonawsDynamodb, | ||
AwsCryptographicMaterialProviders, | ||
TestVectorsAwsCryptographicMaterialProviders, | ||
] | ||
python-version: ["3.11"] | ||
os: [ | ||
# TODO fix Dafny-generated tests on Windows; | ||
# the sys.path workaround for generated Dafny doesn't work on Windows. | ||
# Note: only tests use the sys.path workaround, not source code. | ||
# Windows source code is tested downstream (ex. ESDK-Python CI). | ||
# windows-latest, | ||
ubuntu-latest, | ||
macos-12, | ||
] | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Support longpaths on Git checkout | ||
run: | | ||
git config --global core.longpaths true | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2 | ||
role-session-name: PythonTests | ||
|
||
- uses: actions/checkout@v4 | ||
# The specification submodule is private so we don't have access, but we don't need | ||
# it to verify the Dafny code. Instead we manually pull the submodules we DO need. | ||
- run: git submodule update --init libraries | ||
- run: git submodule update --init smithy-dafny | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/setup-dafny-action@v1.7.0 | ||
with: | ||
dafny-version: ${{ inputs.dafny }} | ||
|
||
- name: Setup Python ${{ matrix.python-version }} for running tests | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade tox | ||
pip install poetry | ||
- name: Build ${{ matrix.library }} implementation | ||
working-directory: ./${{ matrix.library }} | ||
run: | | ||
# This works because `node` is installed by default on GHA runners | ||
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_python CORES=$CORES | ||
- name: Test ${{ matrix.library }} | ||
working-directory: ./${{ matrix.library }} | ||
shell: bash | ||
run: | | ||
make test_python |
This file contains 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 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 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 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 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
Oops, something went wrong.