Skip to content

Commit

Permalink
Merge branch 'mainline' into Golang/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Chaturvedi committed Dec 30, 2024
2 parents 0836d44 + 735f08c commit 8ff37a7
Show file tree
Hide file tree
Showing 1,680 changed files with 205,495 additions and 387 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "AwsEncryptionSDK/runtimes/rust"
schedule:
interval: "daily"
22 changes: 17 additions & 5 deletions .github/workflows/daily_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_codegen.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
daily-ci-verification:
# Don't run the cron builds on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
# daily-ci-java:
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
# uses: ./.github/workflows/library_java_tests.yml
Expand All @@ -27,15 +27,27 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'
daily-ci-rust:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'

daily-ci-interop-tests:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: '4.8.1'
dafny: '4.9.0'

daily-dafny-test-vectors:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_interop_test_vectors.yml
with:
dafny: '4.9.0'

daily-dafny-legacy-test-vectors:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_legacy_interop_test_vectors.yml
with:
dafny: '4.9.0'
122 changes: 107 additions & 15 deletions .github/workflows/library_interop_test_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ubuntu-latest,
macos-13,
]
language: [java, net]
language: [java, net, rust]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand All @@ -38,6 +38,14 @@ jobs:
run: |
git config --global core.longpaths true
# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
role-session-name: InterOpTests

- uses: actions/checkout@v3
# Not all submodules are needed.
# We manually pull the submodule we DO need.
Expand All @@ -51,15 +59,40 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Setup Java in Rust is needed for running polymorph
- name: Setup Java 17
if: matrix.language == 'java'
if: matrix.language == 'java' || matrix.language == 'rust'
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 17

- name: Setup Rust Toolchain for GitHub CI
if: matrix.language == 'rust'
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
# TODO - uncomment this after Rust formatter works
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Remove this after the formatting in Rust starts working
- name: smithy-dafny Rust hacks
if: matrix.language == 'rust'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
fi
- name: Setup NASM for Windows in Rust (aws-lc-sys)
if: matrix.language == 'rust' && matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1

- name: Setup Dafny
uses: dafny-lang/setup-dafny-action@v1.6.1
uses: dafny-lang/setup-dafny-action@v1.7.0
with:
dafny-version: ${{ inputs.dafny }}

Expand Down Expand Up @@ -89,21 +122,33 @@ jobs:
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net
- name: Install Smithy-Dafny codegen dependencies
if: matrix.language == 'rust'
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

# TODO: Remove this after checking in Rust polymorph code
- name: Run make polymorph_rust
if: matrix.language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
make polymorph_rust
- name: Build ${{ matrix.library }} implementation in Rust
if: matrix.language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_rust CORES=$CORES
- name: Setup gradle
if: matrix.language == 'java'
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.2

# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
role-session-name: InterOpTests

- name: Create Manifests
working-directory: ./${{ matrix.library }}
run: make test_generate_vectors_${{ matrix.language }}
Expand Down Expand Up @@ -132,8 +177,8 @@ jobs:
ubuntu-latest,
macos-13,
]
encrypting_language: [java, net]
decrypting_language: [java, net]
encrypting_language: [java, net, rust]
decrypting_language: [java, net, rust]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand All @@ -145,6 +190,7 @@ jobs:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
# TestVectors will call KMS
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -159,19 +205,45 @@ jobs:
- run: git submodule update --init libraries
- run: git submodule update --init --recursive mpl

# Set up runtimes
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
if: matrix.decrypting_language == 'net'
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Setup Java in Rust is needed for running polymorph
- name: Setup Java 17
if: matrix.decrypting_language == 'java'
if: matrix.decrypting_language == 'java' || matrix.decrypting_language == 'rust'
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 17

- name: Setup Rust Toolchain for GitHub CI
if: matrix.decrypting_language == 'rust'
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
# TODO - uncomment this after Rust formatter works
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Remove this after the formatting in Rust starts working
- name: smithy-dafny Rust hacks
if: matrix.decrypting_language == 'rust'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
fi
- name: Setup NASM for Windows in Rust (aws-lc-sys)
if: matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
Expand Down Expand Up @@ -204,6 +276,26 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net
- name: Install Smithy-Dafny codegen dependencies
if: matrix.decrypting_language == 'rust'
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

# TODO: Remove this after checking in Rust polymorph code
- name: Run make polymorph_rust
if: matrix.decrypting_language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
make polymorph_rust
- name: Build ${{ matrix.library }} implementation in Rust
if: matrix.decrypting_language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_rust CORES=$CORES
- name: Download Encrypt Manifest Artifact
uses: actions/download-artifact@v4
with:
Expand Down
Loading

0 comments on commit 8ff37a7

Please sign in to comment.