Skip to content

Commit

Permalink
chore: OrphanedShapes TestModel, GHA uses ubuntu-22.04 (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmcdonald3 authored Jan 16, 2025
1 parent 84523f4 commit 8e428ca
Show file tree
Hide file tree
Showing 45 changed files with 1,092 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
check-java:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Support longpaths
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_dafny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
dafny: "nightly-latest"

cut-issue-on-failure:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
[
dafny-nightly-verification,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
pr-populate-dafny-versions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate Dafny versions list
id: populate-dafny-versions-list
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- pr-ci-rust
- pr-ci-python
- pr-ci-go
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Verify all required jobs passed
uses: re-actors/alls-green@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
pr-populate-dafny-versions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate Dafny versions list
id: populate-dafny-versions-list
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smithy-dafny-conversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
gradle-build-smithy-dafny-conversion:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smithy-polymorph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
os: [ubuntu-22.04, windows-latest, macos-13]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -47,5 +47,5 @@ jobs:
run: make polymorph_dafny

- name: not-grep
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-22.04'
uses: mattsb42-meta/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/test_models_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -30,7 +30,7 @@ jobs:
dafny-version:
- ${{ inputs.dafny }}
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
os: [ubuntu-latest]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_models_go_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -27,7 +27,7 @@ jobs:
fail-fast: false # at least for development; see all errors
matrix:
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
permissions:
id-token: write
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_models_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
permissions:
id-token: write
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_models_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -31,7 +31,7 @@ jobs:
- ${{ inputs.dafny }}
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
dotnet-version: ["6.0.x"]
os: [ubuntu-latest]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_models_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -29,7 +29,7 @@ jobs:
fail-fast: false # at least for development; see all errors
matrix:
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
permissions:
id-token: write
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_models_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
populate-matrix-dimensions:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Populate shard list
id: populate-shard-list
Expand All @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.populate-matrix-dimensions.outputs.shard-list) }}
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
permissions:
id-token: write
contents: read
Expand Down
17 changes: 17 additions & 0 deletions TestModels/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@
# Polymorph Generated Python
**/runtimes/python/src/**/smithygenerated/

# Polymorph Generated Rust
**/src/client.rs
**/src/client
**/src/conversions.rs
**/src/conversions
**/src/deps.rs
**/src/deps
**/src/error.rs
**/src/error
**/src/operation.rs
**/src/operation
**/src/standard_library_conversions.rs
**/src/standard_library_externs.rs
**/src/types.rs
**/src/types
**/target

# .NET Artifacts
**/bin
**/obj
Expand Down
55 changes: 55 additions & 0 deletions TestModels/OrphanedShapes/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

CORES=2

ENABLE_EXTERN_PROCESSING=1
TRANSPILE_TESTS_IN_RUST=1

include ../SharedMakefile.mk

NAMESPACE=simple.orphaned

PROJECT_SERVICES := \
SimpleOrphaned

MAIN_SERVICE_FOR_RUST := SimpleOrphaned

SERVICE_NAMESPACE_SimpleOrphaned=simple.orphaned

SERVICE_DEPS_SimpleOrphaned :=

SMITHY_DEPS=dafny-dependencies/Model/traits.smithy

# This project has no dependencies
# DEPENDENT-MODELS:=

POLYMORPH_OPTIONS=--generate project-files,client-constructors\

# Go

GO_MODULE_NAME="github.com/smithy-lang/smithy-dafny/TestModels/OrphanedShapes"

TRANSLATION_RECORD_GO := \
dafny-dependencies/StandardLibrary/runtimes/go/ImplementationFromDafny-go/ImplementationFromDafny-go.dtr

# Python

PYTHON_MODULE_NAME=simple_orphaned

TRANSLATION_RECORD_PYTHON := \
--translation-record ../dafny-dependencies/StandardLibrary/runtimes/python/src/smithy_dafny_standard_library/internaldafny/generated/dafny_src-py.dtr

# Constants for languages that drop extern names (Python, Go)

TYPES_FILE_PATH=Model/SimpleOrphanedTypes.dfy
TYPES_FILE_WITH_EXTERN_STRING="module {:extern \"simple.orphaned.internaldafny.types\" } SimpleOrphanedTypes"
TYPES_FILE_WITHOUT_EXTERN_STRING="module SimpleOrphanedTypes"

INDEX_FILE_PATH=src/Index.dfy
INDEX_FILE_WITH_EXTERN_STRING="module {:extern \"simple.orphaned.internaldafny\" } SimpleOrphaned refines AbstractSimpleOrphanedService {"
INDEX_FILE_WITHOUT_EXTERN_STRING="module SimpleOrphaned refines AbstractSimpleOrphanedService {"

WRAPPED_INDEX_FILE_PATH=src/WrappedSimpleOrphanedImpl.dfy
WRAPPED_INDEX_FILE_WITH_EXTERN_STRING="module {:options \"--function-syntax:4\"} {:extern \"simple.orphaned.internaldafny.wrapped\"} WrappedSimpleOrphanedService refines WrappedAbstractSimpleOrphanedService {"
WRAPPED_INDEX_FILE_WITHOUT_EXTERN_STRING="module {:options \"--function-syntax:4\"} WrappedSimpleOrphanedService refines WrappedAbstractSimpleOrphanedService {"
130 changes: 130 additions & 0 deletions TestModels/OrphanedShapes/Model/OrphanedShapes.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

$version: "2"
namespace simple.orphaned

@aws.polymorph#localService(
sdkId: "SimpleOrphaned",
config: SimpleOrphanedConfig,
)
service SimpleOrphaned {
version: "2021-11-01",
resources: [],
operations: [],
}

structure SimpleOrphanedConfig {
structureMember: OrphanedConfigShape
}

structure OrphanedConfigShape {
stringMember: String
}

blob OrphanedBlob

boolean OrphanedBoolean

string OrphanedString

// TODO: Once SimpleTypes for commented-out shapes are completed,
// uncomment these and add as members to OrphanedStructure
// byte OrphanedByte

// short OrphanedShort

integer OrphanedInteger

long OrphanedLong

// float OrphanedFloat

// double OrphanedDouble

// bigInteger OrphanedBigInteger

// bigDecimal OrphanedBigDecimal

// timestamp OrphanedTimestamp

// document OrphanedDocument

// This is a smithy V1 Enum
@enum([
{
name: "FIRST",
value: "0x0014",
},
{
name: "SECOND",
value: "0x0046",
},
{
name: "THIRD",
value: "0x0078",
},
])
string OrphanedV1Enum

list OrphanedList {
member: String
}

map OrphanedMap {
key: String
value: String
}

structure OrphanedStructure {
blobValue: OrphanedBlob,
booleanValue: OrphanedBoolean,
stringValue: OrphanedString,
// byteValue: OrphanedByte,
// shortValue: OrphanedShort,
integerValue: OrphanedInteger,
longValue: OrphanedLong,
// floatValue: OrphanedFloat,
// doubleValue: OrphanedDouble,
// bigIntegerValue: OrphanedBigInteger,
// bigDecimalValue: OrphanedBigDecimal,
// timestampValue: OrphanedTimestamp,
unionValue: OrphanedUnion,
enumValue: OrphanedV1Enum,
mapValue: OrphanedMap,
listValue: OrphanedList
}

union OrphanedUnion {
integerValue: Integer
stringValue: String
}

@error("client")
structure OrphanedError {
@required
message: String,
}

@aws.polymorph#reference(resource: OrphanedResource)
structure OrphanedResourceReference {}

@aws.polymorph#extendable
resource OrphanedResource {
operations: [
OrphanedResourceOperation
]
}

operation OrphanedResourceOperation {
input: OrphanedResourceOperationInput
output: OrphanedResourceOperationOutput
}

structure OrphanedResourceOperationInput {
someString: String
}

structure OrphanedResourceOperationOutput {
someString: String
}
Loading

0 comments on commit 8e428ca

Please sign in to comment.