Skip to content

Commit 007442e

Browse files
author
Lucas McDonald
committed
sync
1 parent 3dad2ae commit 007442e

23 files changed

+637
-12
lines changed

.github/workflows/ci_codegen.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ jobs:
6060
- name: Install Smithy-Dafny codegen dependencies
6161
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6262

63-
- name: Install Smithy-Dafny codegen dependencies
64-
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
65-
6663
- uses: ./.github/actions/polymorph_codegen
6764
with:
6865
dafny: ${{ inputs.dafny }}

.github/workflows/ci_examples_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
7373
7474
- name: Install Smithy-Dafny codegen dependencies
75-
if: ${{ inputs.regenerate-code }}
7675
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
7776

7877
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_examples_net.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
git rev-parse HEAD
6161
6262
- name: Install Smithy-Dafny codegen dependencies
63-
if: ${{ inputs.regenerate-code }}
6463
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6564

6665
- name: Regenerate code using smithy-dafny if necessary
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# This workflow performs tests in Python.
2+
name: Python Examples
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+
testPython:
28+
strategy:
29+
matrix:
30+
python-version: [3.11]
31+
os: [macos-13]
32+
runs-on: ${{ matrix.os }}
33+
permissions:
34+
id-token: write
35+
contents: read
36+
steps:
37+
- name: Configure AWS Credentials
38+
uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
aws-region: us-west-2
41+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
42+
role-session-name: DDBEC-Dafny-Python-Tests
43+
44+
- uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Setup Python ${{ matrix.python-version }} for running tests
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install --upgrade tox
57+
pip install poetry
58+
59+
- name: Setup Dafny
60+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
61+
with:
62+
dafny-version: ${{ inputs.dafny }}
63+
64+
- name: Update MPL submodule if using MPL HEAD
65+
if: ${{ inputs.mpl-head == true }}
66+
working-directory: submodules/MaterialProviders
67+
run: |
68+
git checkout main
69+
git pull
70+
git submodule update --init --recursive
71+
git rev-parse HEAD
72+
73+
- name: Install Smithy-Dafny codegen dependencies
74+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
75+
76+
- name: Regenerate code using smithy-dafny if necessary
77+
if: ${{ inputs.regenerate-code }}
78+
uses: ./.github/actions/polymorph_codegen
79+
with:
80+
dafny: ${{ env.DAFNY_VERSION }}
81+
library: DynamoDbEncryption
82+
diff-generated-code: false
83+
update-and-regenerate-mpl: true
84+
85+
- name: Build and locally deploy dependencies for examples
86+
shell: bash
87+
working-directory: ./DynamoDbEncryption
88+
run: |
89+
make transpile_python
90+
91+
- name: Test DynamoDbEncryption Examples
92+
working-directory: ./Examples/runtimes/python
93+
run: |
94+
# Run simple examples
95+
tox -e dynamodbencryption
96+
# Run migration examples
97+
# tox -e migration
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow performs static analysis in Python.
2+
name: Python Static Analysis
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
regenerate-code:
8+
description: "Regenerate code using smithy-dafny"
9+
required: false
10+
default: false
11+
type: boolean
12+
mpl-version:
13+
description: "MPL version to use"
14+
required: false
15+
type: string
16+
mpl-head:
17+
description: "Running on MPL HEAD"
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
jobs:
23+
testPython:
24+
strategy:
25+
matrix:
26+
python-version: [3.11]
27+
os: [ubuntu-latest]
28+
runs-on: ${{ matrix.os }}
29+
permissions:
30+
id-token: write
31+
contents: read
32+
steps:
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
aws-region: us-west-2
37+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
38+
role-session-name: DDBEC-Dafny-Python-Tests
39+
40+
- uses: actions/checkout@v3
41+
with:
42+
submodules: recursive
43+
44+
- name: Setup Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Setup Python ${{ matrix.python-version }} for running tests
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install --upgrade tox
53+
pip install poetry
54+
55+
- name: Update MPL submodule if using MPL HEAD
56+
if: ${{ inputs.mpl-head == true }}
57+
working-directory: submodules/MaterialProviders
58+
run: |
59+
git checkout main
60+
git pull
61+
git submodule update --init --recursive
62+
git rev-parse HEAD
63+
64+
- name: Install Smithy-Dafny codegen dependencies
65+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
66+
67+
- name: Regenerate code using smithy-dafny if necessary
68+
if: ${{ inputs.regenerate-code }}
69+
uses: ./.github/actions/polymorph_codegen
70+
with:
71+
dafny: ${{ env.DAFNY_VERSION }}
72+
library: DynamoDbEncryption
73+
diff-generated-code: false
74+
update-and-regenerate-mpl: true
75+
76+
- name: Run static analysis
77+
working-directory: ./DynamoDbEncryption/runtimes/python
78+
run: |
79+
tox -e lint-check

.github/workflows/ci_test_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
6767
6868
- name: Install Smithy-Dafny codegen dependencies
69-
if: ${{ inputs.regenerate-code }}
7069
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
7170

7271
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_latest_released_mpl_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
dafny-version: ${{ needs.getVersion.outputs.version }}
6060

6161
- name: Install Smithy-Dafny codegen dependencies
62-
if: ${{ inputs.regenerate-code }}
6362
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6463

6564
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_net.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
git rev-parse HEAD
6262
6363
- name: Install Smithy-Dafny codegen dependencies
64-
if: ${{ inputs.regenerate-code }}
6564
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6665

6766
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_python.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# This workflow runs only Dafny-transpiled Python tests.
2+
name: test python
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-head:
17+
description: "Running on MPL HEAD"
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
jobs:
23+
testPython:
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
library: [DynamoDbEncryption]
28+
python-version: ["3.11", "3.12", "3.13"]
29+
os: [
30+
macos-13,
31+
ubuntu-22.04,
32+
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
33+
# Windows is tested with non-Dafny-transpiled Python tests.
34+
# windows-latest
35+
]
36+
runs-on: ${{ matrix.os }}
37+
permissions:
38+
id-token: write
39+
contents: read
40+
steps:
41+
- name: Support longpaths on Git checkout
42+
run: |
43+
git config --global core.longpaths true
44+
- uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Setup Python ${{ matrix.python-version }} for running tests
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install --upgrade tox
57+
pip install poetry
58+
59+
- name: Setup Dafny
60+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
61+
with:
62+
dafny-version: ${{ inputs.dafny }}
63+
64+
- name: Update MPL submodule if using MPL HEAD
65+
if: ${{ inputs.mpl-head == true }}
66+
working-directory: submodules/MaterialProviders
67+
run: |
68+
git checkout main
69+
git pull
70+
git submodule update --init --recursive
71+
git rev-parse HEAD
72+
73+
- name: Install Smithy-Dafny codegen dependencies
74+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
75+
76+
- name: Regenerate code using smithy-dafny if necessary
77+
if: ${{ inputs.regenerate-code }}
78+
uses: ./.github/actions/polymorph_codegen
79+
with:
80+
dafny: ${{ env.DAFNY_VERSION }}
81+
library: ${{ matrix.library }}
82+
diff-generated-code: false
83+
update-and-regenerate-mpl: true
84+
85+
- name: Download Dependencies
86+
working-directory: ./${{ matrix.library }}
87+
run: make setup_python
88+
89+
- name: Configure AWS Credentials
90+
uses: aws-actions/configure-aws-credentials@v4
91+
with:
92+
aws-region: us-west-2
93+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
94+
role-session-name: DDBEC-Dafny-Net-Tests
95+
96+
- name: Compile ${{ matrix.library }} implementation
97+
shell: bash
98+
working-directory: ./${{ matrix.library }}
99+
run: |
100+
# This works because `node` is installed by default on GHA runners
101+
CORES=$(node -e 'console.log(os.cpus().length)')
102+
make transpile_python CORES=$CORES
103+
104+
- name: Test ${{ matrix.library }} Dafny-transpiled Python tests
105+
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
106+
# Windows is tested with non-Dafny-transpiled Python tests.
107+
if: ${{ matrix.os != 'windows-latest' }}
108+
working-directory: ./${{ matrix.library }}/runtimes/python
109+
shell: bash
110+
run: |
111+
tox -e dafnytests
112+
113+
- name: Test ${{ matrix.library }} Python unit tests
114+
working-directory: ./${{ matrix.library }}/runtimes/python
115+
shell: bash
116+
run: |
117+
tox -e unit
118+
119+
- name: Test ${{ matrix.library }} Python integration tests
120+
working-directory: ./${{ matrix.library }}/runtimes/python
121+
shell: bash
122+
run: |
123+
tox -e integ
124+
125+
- name: Test ${{ matrix.library }} Python coverage
126+
working-directory: ./${{ matrix.library }}/runtimes/python
127+
shell: bash
128+
run: |
129+
tox -e encrypted-interface-coverage
130+
tox -e client-to-resource-conversions-coverage
131+
tox -e resource-to-client-conversions-coverage

.github/workflows/ci_test_vector_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ jobs:
8080
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
8181
8282
- name: Install Smithy-Dafny codegen dependencies
83-
if: ${{ inputs.regenerate-code }}
8483
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
8584

8685
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_vector_net.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
git rev-parse HEAD
7272
7373
- name: Install Smithy-Dafny codegen dependencies
74-
if: ${{ inputs.regenerate-code }}
7574
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
7675

7776
- name: Regenerate code using smithy-dafny if necessary

0 commit comments

Comments
 (0)