-
Notifications
You must be signed in to change notification settings - Fork 19
77 lines (68 loc) · 2.23 KB
/
Copy pathci_codegen.yml
File metadata and controls
77 lines (68 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This workflow regenerates code using smithy-dafny and checks that the output matches what's checked in.
name: Library Code Generation
on:
workflow_call:
inputs:
dafny:
description: "The dafny version to run"
required: true
type: string
jobs:
code-generation:
permissions:
contents: read
pull-requests: write
id-token: write
strategy:
fail-fast: false
matrix:
library: [DynamoDbEncryption, TestVectors]
# Note dotnet is only used for formatting generated code
# in this workflow
dotnet-version: ["6.0.x"]
os: [ubuntu-22.04]
go-version: [1.23]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
steps:
- name: Support longpaths
run: |
git config --global core.longpaths true
- uses: actions/checkout@v6
with:
submodules: recursive
- run: git submodule update --init --recursive submodules/smithy-dafny
# Only used to format generated code
# and to translate version strings such as "nightly-latest"
# to an actual DAFNY_VERSION.
- name: Setup Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
with:
dafny-version: ${{ inputs.dafny }}
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Create temporary global.json
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
- name: Setup Java 17 for codegen
uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: "17"
- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
- uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: true