Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"

# GitHub Actions

The MPL uses GitHub Actions to trigger our testing.
If a GitHub Action job/workflow is going to be added, and that job should always run, it should be added to `ci.yml`.

This stops us from having multiple copies of the same event.

Instead, we build a hierarchy of testing:

- `routine_ci` determines regular testing events, such as daily, PR, or push to main
- `ci.yml` is triggered by `routine_ci` or other events, and runs all the per runtime testing
- `library_<runtime>_tests` are responsible for a runtimes particular testing suite.

# `library_<runtime>_tests`

In general, these should have at least two inputs:

- The Dafny Verision
- Weather Smithy-Dafny should be re-run
6 changes: 2 additions & 4 deletions .github/workflows/check_dafny_runtime_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
name: Check DafnyRuntimePython Version Consistency

on:
pull_request:
push:
branches:
- main
workflow_call:
workflow_dispatch:

jobs:
check-version-consistency:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
name: Check Release Files

on:
pull_request:
workflow_call:
workflow_dispatch:

jobs:
require-approvals:
Expand All @@ -14,7 +15,7 @@ jobs:
env:
# unfortunately we can't check if the approver is part of the CODEOWNERS. This is a subset of aws/aws-crypto-tools-team
# to add more allowlisted approvers just modify this env variable
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, kessplas, RitvikKapila, ajewellamz
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, kessplas, ajewellamz
steps:
- uses: actions/checkout@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check_only_keyword.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
name: Check {:only} decorator presence

on:
pull_request:
workflow_call:
workflow_dispatch:

jobs:
grep-only-verification-keyword:
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# These are all the tests needed in general
name: Continious Integration Tests

on:
# This workflow is invoked by other workflows with the requested Dafny build.
# It represents all the required testing for the MPL.
workflow_dispatch:
inputs:
dafnyTranspilerVersion:
description: "The Dafny Transpiler and Runtime to use for all but Rust"
required: true
type: string
dafnyVerifyVersion:
description: "The Dafny Verifier Version to use"
required: true
type: string
dafnyRustVersion:
description: "The Dafny Transpiler and Runtime to use for Rust"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean
workflow_call:
inputs:
dafnyTranspilerVersion:
description: "The Dafny Transpiler and Runtime to use for all but Rust"
required: true
type: string
dafnyVerifyVersion:
description: "The Dafny Verifier Version to use"
required: true
type: string
dafnyRustVersion:
description: "The Dafny Transpiler and Runtime to use for Rust"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean

jobs:
sem-ver:
uses: ./.github/workflows/sem_ver.yml
check-files:
uses: ./.github/workflows/check_files.yml
check-only:
uses: ./.github/workflows/check_only_keyword.yml
ci-not-grep:
uses: ./.github/workflows/ci_static_analysis.yml
ci-format:
uses: ./.github/workflows/library_format.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
ci-codegen:
uses: ./.github/workflows/library_codegen.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
ci-verification:
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
ci-java:
uses: ./.github/workflows/library_java_tests.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
ci-net:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
ci-rust:
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: ${{ inputs.dafnyRustVersion }}
# Rust always regenerates code
ci-python-check-version-consistency:
uses: ./.github/workflows/check_dafny_runtime_versions.yml
ci-python:
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
ci-go:
uses: ./.github/workflows/library_go_tests.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
interop-test:
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: ${{ inputs.dafnyVerifyVersion }}
regenerate-code: ${{ inputs.regenerate-code }}
secrets: inherit
all-required:
if: always()
needs:
- ci-format
- ci-codegen
- ci-verification
- ci-java
- ci-net
- ci-python
- ci-go
- ci-rust
- interop-test
runs-on: ubuntu-22.04
steps:
- name: Verify all required jobs passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
name: static analysis

on:
pull_request:
push:
branches:
- main
workflow_call:
workflow_dispatch:

jobs:
not-grep:
Expand Down
66 changes: 0 additions & 66 deletions .github/workflows/daily_ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/library_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ jobs:

- uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: true
2 changes: 1 addition & 1 deletion .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/library_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ on:

jobs:
format_projects:
# Don't run the nightly build on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
strategy:
matrix:
library:
Expand Down Expand Up @@ -81,11 +79,9 @@ jobs:
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make format_net-check

format_java_misc:
# Don't run the nightly build on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
runs-on: ubuntu-22.04

steps:
- name: Support longpaths
run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/library_go_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ jobs:
- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

- name: Build ${{ matrix.library }} implementation
working-directory: ./${{ matrix.library }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/library_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ jobs:
- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

- name: Build ${{ matrix.library }} implementation
working-directory: ./${{ matrix.library }}
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/library_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
description: "The Dafny version to run"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean

jobs:
testRust:
Expand Down
Loading
Loading