|
8 | 8 | workflow_dispatch: # allows triggering this manually through the Actions UI
|
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - getDBESDKDafnyVersion: |
12 |
| - # Don't run the cron builds on forks |
13 |
| - if: github.event_name != 'schedule' || github.repository_owner == 'aws' |
14 |
| - uses: ./.github/workflows/dafny_version.yml |
15 |
| - getVerifyDBESDKDafnyVersion: |
16 |
| - if: github.event_name != 'schedule' || github.repository_owner == 'aws' |
17 |
| - uses: ./.github/workflows/dafny_verify_version.yml |
18 |
| - getLatestReleaseMplVersion: |
19 |
| - if: github.event_name != 'schedule' || github.repository_owner == 'aws' |
20 |
| - uses: ./.github/workflows/mpl_latest_release_version.yml |
21 |
| - getMplDafnyVersion: |
22 |
| - needs: getLatestReleaseMplVersion |
23 |
| - if: github.event_name != 'schedule' || github.repository_owner == 'aws' |
24 |
| - uses: ./.github/workflows/mpl_head_version.yml |
25 |
| - with: |
26 |
| - mpl-head: ${{needs.getLatestReleaseMplVersion.outputs.version}} |
27 |
| - test-latest-released-mpl-java: |
28 |
| - needs: [getDafnyVersion, getLatestReleaseMplVersion, getMplDafnyVersion] |
29 |
| - uses: ./.github/workflows/dafny-interop.yml |
30 |
| - with: |
31 |
| - mpl-dafny: ${{needs.getLatestReleaseMplVersion.outputs.version}} |
32 |
| - mpl-commit: ${{needs.getMplDafnyVersion.outputs.dafnyVersion}} |
33 |
| - dbesdk-dafny: ${{needs.getDBESDKDafnyVersion.outputs.version}} |
| 11 | + testJava: |
| 12 | + strategy: |
| 13 | + max-parallel: 1 |
| 14 | + matrix: |
| 15 | + java-version: [8, 11, 16, 17] |
| 16 | + os: [macos-13] |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + permissions: |
| 19 | + id-token: write |
| 20 | + contents: read |
| 21 | + steps: |
| 22 | + - name: Configure AWS Credentials |
| 23 | + uses: aws-actions/configure-aws-credentials@v4 |
| 24 | + with: |
| 25 | + aws-region: us-west-2 |
| 26 | + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2 |
| 27 | + role-session-name: DDBEC-Dafny-Java-Tests |
| 28 | + |
| 29 | + - uses: actions/checkout@v3 |
| 30 | + with: |
| 31 | + submodules: recursive |
| 32 | + |
| 33 | + - name: Setup Java ${{ matrix.java-version }} |
| 34 | + uses: actions/setup-java@v4 |
| 35 | + with: |
| 36 | + distribution: "corretto" |
| 37 | + java-version: ${{ matrix.java-version }} |
| 38 | + |
| 39 | + - name: Setup Dafny |
| 40 | + uses: dafny-lang/[email protected] |
| 41 | + with: |
| 42 | + dafny-version: ${{ inputs.dafny }} |
| 43 | + |
| 44 | + - name: Regenerate code using smithy-dafny if necessary |
| 45 | + if: ${{ inputs.regenerate-code }} |
| 46 | + uses: ./.github/actions/polymorph_codegen |
| 47 | + with: |
| 48 | + dafny: ${{ env.DAFNY_VERSION }} |
| 49 | + library: DynamoDbEncryption |
| 50 | + diff-generated-code: false |
| 51 | + update-and-regenerate-mpl: true |
| 52 | + |
| 53 | + # The following two steps: "Build and deploy to maven local" and "Run Extensive Tests" |
| 54 | + # mimic the tests in ./codebuild/staging/release-staging.yml |
| 55 | + - name: Build and deploy to maven local |
| 56 | + shell: bash |
| 57 | + working-directory: ./DynamoDbEncryption |
| 58 | + run: | |
| 59 | + # Run transpile by itself. We don't want to locally build the MPL because |
| 60 | + # we want to verify that the version pulled down from maven works correctly |
| 61 | + make transpile_implementation_java |
| 62 | + make transpile_test_java |
| 63 | + make mvn_local_deploy |
| 64 | + make test_java |
| 65 | +
|
| 66 | + - name: Run Extensive Tests |
| 67 | + working-directory: ./DynamoDbEncryption |
| 68 | + run: | |
| 69 | + gradle -p runtimes/java clean |
| 70 | + gradle -p runtimes/java test |
| 71 | +
|
| 72 | + # The following three steps: "Transpile MPL Test Vectors without recursively building the MPL", |
| 73 | + # "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/release-staging.yml |
| 74 | + - name: Transpile MPL Test Vectors without recursively building the MPL |
| 75 | + working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders |
| 76 | + run: | |
| 77 | + # Run transpile by itself. We don't want to locally build the MPL because |
| 78 | + # we want to verify that the version pulled down from maven works correctly |
| 79 | + make transpile_implementation_java |
| 80 | + make transpile_test_java |
| 81 | + make mvn_local_deploy |
| 82 | +
|
| 83 | + - name: Run Test Vectors |
| 84 | + working-directory: ./TestVectors |
| 85 | + run: | |
| 86 | + # Spin up ddb local |
| 87 | + docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors * |
| 88 | + # Run transpile by itself so we don't locally build the MPL. |
| 89 | + make transpile_implementation_java |
| 90 | + make transpile_test_java |
| 91 | + gradle -p runtimes/java runTests |
| 92 | +
|
| 93 | + - name: Test Examples |
| 94 | + working-directory: ./Examples |
| 95 | + run: | |
| 96 | + # Run Simple Examples |
| 97 | + gradle -p runtimes/java/DynamoDbEncryption test |
| 98 | + # Run Migration Examples |
| 99 | + gradle -p runtimes/java/Migration/PlaintextToAWSDBE test |
| 100 | + gradle -p runtimes/java/Migration/DDBECToAWSDBE test |
0 commit comments