|
| 1 | +# This workflow performs static analysis checks. |
| 2 | +name: Test Vectors Dafny verification |
| 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 | + |
| 17 | +jobs: |
| 18 | + verification: |
| 19 | + # Don't run the nightly build on forks |
| 20 | + if: github.event_name != 'schedule' || github.repository_owner == 'aws' |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + os: [macos-12] |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + defaults: |
| 26 | + run: |
| 27 | + shell: bash |
| 28 | + env: |
| 29 | + DOTNET_CLI_TELEMETRY_OPTOUT: 1 |
| 30 | + DOTNET_NOLOGO: 1 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + with: |
| 34 | + submodules: recursive |
| 35 | + |
| 36 | + - name: Setup Dafny |
| 37 | + uses: dafny-lang/[email protected] |
| 38 | + with: |
| 39 | + dafny-version: ${{ inputs.dafny }} |
| 40 | + |
| 41 | + # dafny-reportgenerator requires next6 |
| 42 | + # but only 7.0 is installed on macos-12-large |
| 43 | + - name: Setup .NET Core SDK '6.0.x' |
| 44 | + uses: actions/setup-dotnet@v3 |
| 45 | + with: |
| 46 | + dotnet-version: "6.0.x" |
| 47 | + |
| 48 | + - name: Regenerate code using smithy-dafny if necessary |
| 49 | + if: ${{ inputs.regenerate-code }} |
| 50 | + uses: ./.github/actions/polymorph_codegen |
| 51 | + with: |
| 52 | + dafny: ${{ env.DAFNY_VERSION }} |
| 53 | + library: TestVectors |
| 54 | + diff-generated-code: false |
| 55 | + |
| 56 | + - name: Verify TestVectors |
| 57 | + working-directory: ./TestVectors |
| 58 | + run: | |
| 59 | + # This works because `node` is installed by default on GHA runners |
| 60 | + CORES=$(node -e 'console.log(os.cpus().length)') |
| 61 | + make verify CORES=$CORES |
| 62 | +
|
| 63 | + - name: Check solver resource use |
| 64 | + if: success() || failure() |
| 65 | + working-directory: ./TestVectors |
| 66 | + run: | |
| 67 | + make dafny-reportgenerator |
0 commit comments