|
| 1 | +# This workflow performs test vectors in Python with the client interface. |
| 2 | +name: Library Python Test Vectors Client Interface Interop Tests |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + mpl-dafny: |
| 8 | + description: "The Dafny version to compile the MPL with (4.2.0, dafny-nightly, etc..)" |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + mpl-commit: |
| 12 | + description: "The MPL commit to use" |
| 13 | + required: false |
| 14 | + default: "main" |
| 15 | + type: string |
| 16 | + mpl-version: |
| 17 | + description: "The MPL version to use" |
| 18 | + required: true |
| 19 | + type: string |
| 20 | + dbesdk-dafny: |
| 21 | + description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)" |
| 22 | + required: true |
| 23 | + type: string |
| 24 | + |
| 25 | +jobs: |
| 26 | + testPython: |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + library: [TestVectors] |
| 30 | + python-version: [3.11, 3.12, 3.12] |
| 31 | + os: [ubuntu-22.04] |
| 32 | + interface: [client, resource, table] |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + permissions: |
| 35 | + id-token: write |
| 36 | + contents: read |
| 37 | + steps: |
| 38 | + - name: Setup DynamoDB Local |
| 39 | + |
| 40 | + with: |
| 41 | + port: 8000 |
| 42 | + cors: "*" |
| 43 | + |
| 44 | + - name: Configure AWS Credentials |
| 45 | + uses: aws-actions/configure-aws-credentials@v4 |
| 46 | + with: |
| 47 | + aws-region: us-west-2 |
| 48 | + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2 |
| 49 | + role-session-name: DDBEC-Dafny-Python-Tests |
| 50 | + |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + with: |
| 53 | + submodules: recursive |
| 54 | + fetch-depth: 0 |
| 55 | + |
| 56 | + - name: Setup MPL Dafny |
| 57 | + uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/ |
| 58 | + with: |
| 59 | + dafny-version: ${{ inputs.mpl-dafny }} |
| 60 | + |
| 61 | + - name: Update MPL submodule |
| 62 | + working-directory: submodules/MaterialProviders |
| 63 | + run: | |
| 64 | + git fetch |
| 65 | + git checkout ${{inputs.mpl-commit}} |
| 66 | + git submodule update --init --recursive |
| 67 | + git rev-parse HEAD |
| 68 | +
|
| 69 | + - name: Setup Python ${{ matrix.python-version }} |
| 70 | + uses: actions/setup-python@v4 |
| 71 | + with: |
| 72 | + python-version: ${{ matrix.python-version }} |
| 73 | + |
| 74 | + - name: Build MPL with Dafny ${{inputs.mpl-dafny}} |
| 75 | + working-directory: submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders |
| 76 | + run: | |
| 77 | + # This works because `node` is installed by default on GHA runners |
| 78 | + CORES=$(node -e 'console.log(os.cpus().length)') |
| 79 | + make build_python CORES=$CORES |
| 80 | +
|
| 81 | + - name: Setup DBESDK Dafny |
| 82 | + uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/ |
| 83 | + with: |
| 84 | + dafny-version: ${{ inputs.dbesdk-dafny}} |
| 85 | + |
| 86 | + - name: Build DynamoDbEncryption implementation |
| 87 | + shell: bash |
| 88 | + working-directory: DynamoDbEncryption |
| 89 | + run: | |
| 90 | + make transpile_python |
| 91 | +
|
| 92 | + - name: Build TestVectors implementation |
| 93 | + shell: bash |
| 94 | + working-directory: ${{matrix.library}} |
| 95 | + run: | |
| 96 | + make transpile_python |
| 97 | +
|
| 98 | + - name: Test TestVectors |
| 99 | + working-directory: ./TestVectors |
| 100 | + run: | |
| 101 | + make test_python_${{matrix.interface}}_interface |
0 commit comments