|
1 |
| -# This workflow performs test vectors in Python with the client interface. |
2 |
| -name: Library Python Test Vectors Client Interface Interop Tests |
| 1 | +# This workflow performs test vectors in Python. |
| 2 | +name: Library Python Test Vectors |
3 | 3 |
|
4 | 4 | on:
|
5 | 5 | workflow_call:
|
6 | 6 | inputs:
|
7 |
| - mpl-dafny: |
8 |
| - description: "The Dafny version to compile the MPL with (4.2.0, dafny-nightly, etc..)" |
| 7 | + dafny: |
| 8 | + description: "The Dafny version to run" |
9 | 9 | required: true
|
10 | 10 | type: string
|
11 |
| - mpl-commit: |
12 |
| - description: "The MPL commit to use" |
| 11 | + regenerate-code: |
| 12 | + description: "Regenerate code using smithy-dafny" |
13 | 13 | required: false
|
14 |
| - default: "main" |
15 |
| - type: string |
| 14 | + default: false |
| 15 | + type: boolean |
16 | 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 |
| 17 | + description: "MPL version to use" |
| 18 | + required: false |
23 | 19 | type: string
|
| 20 | + mpl-head: |
| 21 | + description: "Running on MPL HEAD" |
| 22 | + required: false |
| 23 | + default: false |
| 24 | + type: boolean |
24 | 25 |
|
25 | 26 | jobs:
|
26 | 27 | testPython:
|
@@ -51,51 +52,44 @@ jobs:
|
51 | 52 | - uses: actions/checkout@v3
|
52 | 53 | with:
|
53 | 54 | submodules: recursive
|
54 |
| - fetch-depth: 0 |
55 | 55 |
|
56 |
| - - name: Setup MPL Dafny |
| 56 | + - name: Setup Dafny |
57 | 57 | uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
|
58 | 58 | with:
|
59 |
| - dafny-version: ${{ inputs.mpl-dafny }} |
| 59 | + dafny-version: ${{ inputs.dafny }} |
60 | 60 |
|
61 |
| - - name: Update MPL submodule |
| 61 | + - name: Update MPL submodule if using MPL HEAD |
| 62 | + if: ${{ inputs.mpl-head == true }} |
62 | 63 | working-directory: submodules/MaterialProviders
|
63 | 64 | run: |
|
64 |
| - git fetch |
65 |
| - git checkout ${{inputs.mpl-commit}} |
| 65 | + git checkout main |
| 66 | + git pull |
66 | 67 | git submodule update --init --recursive
|
67 | 68 | git rev-parse HEAD
|
68 | 69 |
|
| 70 | + - name: Regenerate code using smithy-dafny if necessary |
| 71 | + if: ${{ inputs.regenerate-code }} |
| 72 | + uses: ./.github/actions/polymorph_codegen |
| 73 | + with: |
| 74 | + dafny: ${{ env.DAFNY_VERSION }} |
| 75 | + library: ${{ matrix.library }} |
| 76 | + diff-generated-code: false |
| 77 | + update-and-regenerate-mpl: true |
| 78 | + |
69 | 79 | - name: Setup Python ${{ matrix.python-version }}
|
70 | 80 | uses: actions/setup-python@v4
|
71 | 81 | with:
|
72 | 82 | python-version: ${{ matrix.python-version }}
|
73 | 83 |
|
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 | 84 | - name: Build TestVectors implementation
|
93 | 85 | shell: bash
|
94 | 86 | working-directory: ${{matrix.library}}
|
95 | 87 | run: |
|
96 |
| - make transpile_python |
| 88 | + # This works because `node` is installed by default on GHA runners |
| 89 | + CORES=$(node -e 'console.log(os.cpus().length)') |
| 90 | + make build_python CORES=$CORES |
97 | 91 |
|
98 | 92 | - name: Test TestVectors
|
99 |
| - working-directory: ./TestVectors |
| 93 | + working-directory: ${{matrix.library}} |
100 | 94 | run: |
|
101 | 95 | make test_python_${{matrix.interface}}_interface
|
0 commit comments