|
| 1 | +# This workflow performs tests in Go. |
| 2 | +name: Library Go tests |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + dafny: |
| 8 | + description: "The Dafny version to run" |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + regenerate-code: |
| 12 | + description: "Regenerate code using smithy-dafny" |
| 13 | + required: false |
| 14 | + default: false |
| 15 | + type: boolean |
| 16 | + mpl-version: |
| 17 | + description: "MPL version to use" |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + mpl-head: |
| 21 | + description: "Running on MPL HEAD" |
| 22 | + required: false |
| 23 | + default: false |
| 24 | + type: boolean |
| 25 | + |
| 26 | +jobs: |
| 27 | + testGo: |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + library: [DynamoDbEncryption] |
| 31 | + os: [macos-13] |
| 32 | + go-version: ["1.23"] |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + permissions: |
| 35 | + id-token: write |
| 36 | + contents: read |
| 37 | + steps: |
| 38 | + - name: Configure AWS Credentials |
| 39 | + uses: aws-actions/configure-aws-credentials@v4 |
| 40 | + with: |
| 41 | + aws-region: us-west-2 |
| 42 | + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2 |
| 43 | + role-session-name: DDBEC-Dafny-Java-Tests |
| 44 | + |
| 45 | + - uses: actions/checkout@v3 |
| 46 | + with: |
| 47 | + submodules: recursive |
| 48 | + |
| 49 | + - name: Setup Dafny |
| 50 | + uses: dafny-lang/[email protected] |
| 51 | + with: |
| 52 | + dafny-version: ${{ inputs.dafny }} |
| 53 | + |
| 54 | + - name: Update MPL submodule if using MPL HEAD |
| 55 | + if: ${{ inputs.mpl-head == true }} |
| 56 | + working-directory: submodules/MaterialProviders |
| 57 | + run: | |
| 58 | + git checkout main |
| 59 | + git pull |
| 60 | + git submodule update --init --recursive |
| 61 | + git rev-parse HEAD |
| 62 | +
|
| 63 | + - name: Update project.properties if using MPL HEAD |
| 64 | + if: ${{ inputs.mpl-head == true }} |
| 65 | + run: | |
| 66 | + sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties |
| 67 | +
|
| 68 | + # - name: Regenerate code using smithy-dafny if necessary |
| 69 | + # if: ${{ inputs.regenerate-code }} |
| 70 | + # uses: ./.github/actions/polymorph_codegen |
| 71 | + # with: |
| 72 | + # dafny: ${{ env.DAFNY_VERSION }} |
| 73 | + # library: ${{ matrix.library }} |
| 74 | + # diff-generated-code: false |
| 75 | + # update-and-regenerate-mpl: true |
| 76 | + |
| 77 | + - name: Install Go |
| 78 | + uses: actions/setup-go@v5 |
| 79 | + with: |
| 80 | + go-version: ${{ matrix.go-version }} |
| 81 | + |
| 82 | + - name: Install Go imports |
| 83 | + run: | |
| 84 | + go install golang.org/x/tools/cmd/goimports@latest |
0 commit comments