Skip to content

Commit 39dd9e6

Browse files
merge
2 parents 8026da0 + fe03425 commit 39dd9e6

File tree

2,306 files changed

+303414
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,306 files changed

+303414
-318
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# This local action sets up code dependencies
3+
# to run Smithy-Dafny CI in GitHub Actions workflows.
4+
#
5+
6+
name: "Install Smithy-Dafny codegen dependencies"
7+
description: "Install Java package dependencies required to run Smithy-Dafny codegen"
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Install smithy-dafny-codegen Rust dependencies locally
12+
uses: gradle/gradle-build-action@v2
13+
with:
14+
arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML
15+
build-root-directory: submodules/smithy-dafny/smithy-dafny-codegen-modules/smithy-rs
16+
17+
- name: Install smithy-dafny-codegen Python dependencies locally
18+
uses: gradle/gradle-build-action@v2
19+
with:
20+
arguments: :smithy-python-codegen:pTML
21+
build-root-directory: submodules/smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen

.github/actions/polymorph_codegen/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ runs:
9797
run: |
9898
echo "PROJECT_DEPENDENCIES=${{ inputs.update-and-regenerate-mpl != 'true' && 'PROJECT_DEPENDENCIES=' || '' }}" >> $GITHUB_OUTPUT
9999
100+
- name: Print dotnet version
101+
shell: bash
102+
run: |
103+
dotnet --version
104+
100105
- name: Regenerate Dafny code using smithy-dafny
101106
# Unfortunately Dafny codegen doesn't work on Windows:
102107
# https://github.com/smithy-lang/smithy-dafny/issues/317

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ updates:
2020
directory: ".github/workflows"
2121
schedule:
2222
interval: "daily"
23+
- package-ecosystem: "cargo"
24+
directory: "DynamoDbEncryption/runtimes/rust"
25+
schedule:
26+
interval: "daily"

.github/workflows/check-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
env:
1515
# unfortunately we can't check if the approver is part of the CODEOWNERS. This is a subset of aws/aws-crypto-tools-team
1616
# to add more allowlisted approvers just modify this env variable
17-
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, justplaz, ajewellamz
17+
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, kessplas, ajewellamz, RitvikKapila
1818
steps:
1919
- uses: actions/checkout@v3
2020
with:
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow checks if you are checking in dafny code
2+
# with the keyword {:only}, it adds a message to the pull
3+
# request to remind you to remove it.
4+
name: Check {:only} decorator presence
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
grep-only-verification-keyword:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check only keyword
21+
id: only-keyword
22+
shell: bash
23+
run:
24+
# checking in code with the dafny decorator {:only}
25+
# will not verify the entire file or maybe the entire project depending on its configuration
26+
# This action checks if you are either adding or removing the {:only} decorator and posting on the pr if you are.
27+
echo "ONLY_KEYWORD=$(git diff origin/main origin/${GITHUB_HEAD_REF} **/*.dfy | grep -i {:only})" >> "$GITHUB_OUTPUT"
28+
29+
- name: Check if ONLY_KEYWORD is not empty
30+
id: comment
31+
env:
32+
PR_NUMBER: ${{ github.event.number }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
ONLY_KEYWORD: ${{ steps.only-keyword.outputs.ONLY_KEYWORD }}
35+
if: ${{env.ONLY_KEYWORD != ''}}
36+
run: |
37+
COMMENT="It looks like you are adding or removing the dafny keyword {:only}.\nIs this intended?"
38+
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
39+
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
40+
exit 1

.github/workflows/ci_codegen.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- uses: actions/checkout@v3
3434
with:
3535
submodules: recursive
36+
- run: git submodule update --init --recursive submodules/smithy-dafny
3637

3738
# Only used to format generated code
3839
# and to translate version strings such as "nightly-latest"
@@ -47,8 +48,20 @@ jobs:
4748
with:
4849
dotnet-version: ${{ matrix.dotnet-version }}
4950

51+
- name: Create temporary global.json
52+
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
53+
54+
- name: Setup Java 17 for codegen
55+
uses: actions/setup-java@v3
56+
with:
57+
distribution: "corretto"
58+
java-version: "17"
59+
60+
- name: Install Smithy-Dafny codegen dependencies
61+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
62+
5063
- uses: ./.github/actions/polymorph_codegen
5164
with:
52-
dafny: ${{ env.DAFNY_VERSION }}
65+
dafny: ${{ inputs.dafny }}
5366
library: ${{ matrix.library }}
5467
diff-generated-code: true

.github/workflows/ci_examples_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
max-parallel: 1
3030
matrix:
3131
java-version: [8, 11, 16, 17]
32-
os: [macos-12]
32+
os: [macos-13]
3333
runs-on: ${{ matrix.os }}
3434
permissions:
3535
id-token: write

.github/workflows/ci_examples_net.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
library: [DynamoDbEncryption]
2929
dotnet-version: ["6.0.x"]
30-
os: [macos-12]
30+
os: [macos-13]
3131
runs-on: ${{ matrix.os }}
3232
permissions:
3333
id-token: write

.github/workflows/ci_test_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
library: [DynamoDbEncryption]
3131
java-version: [8, 11, 16, 17]
32-
os: [macos-12]
32+
os: [macos-13]
3333
runs-on: ${{ matrix.os }}
3434
permissions:
3535
id-token: write

.github/workflows/ci_test_net.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
library: [DynamoDbEncryption]
2727
dotnet-version: ["6.0.x"]
28-
os: [macos-12, ubuntu-latest, windows-latest]
28+
os: [macos-13, ubuntu-latest, windows-latest]
2929
runs-on: ${{ matrix.os }}
3030
permissions:
3131
id-token: write

0 commit comments

Comments
 (0)