-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add some bad typings test cases
- Loading branch information
Showing
25 changed files
with
326 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/test/resources/bad-typings/inputs_enum_list_item_with_non_sequence_allowed_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
granted-scopes: | ||
type: list | ||
separator: ',' | ||
list-item: | ||
type: enum | ||
allowed-values: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'granted-scopes' is invalid: Value for 'list-item' is invalid: Value for 'allowed-values' is invalid: Expected a list, but got a scalar value | ||
# |
11 changes: 11 additions & 0 deletions
11
src/test/resources/bad-typings/inputs_enum_with_non_sequence_allowed_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
permissions: | ||
type: enum | ||
allowed-values: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'permissions' is invalid: Value for 'allowed-values' is invalid: Expected a list, but got a scalar value | ||
# |
15 changes: 15 additions & 0 deletions
15
src/test/resources/bad-typings/inputs_integer_list_item_with_non_mapping_named_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
list-of-integer: | ||
type: list | ||
separator: ',' | ||
list-item: | ||
type: integer | ||
name: AllowedValues | ||
named-values: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'list-of-integer' is invalid: Value for 'list-item' is invalid: Value for 'named-values' is invalid: Expected a map, but got a list | ||
# |
12 changes: 12 additions & 0 deletions
12
src/test/resources/bad-typings/inputs_integer_with_non_mapping_named_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
retries: | ||
type: integer | ||
name: AllowedValues | ||
named-values: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'retries' is invalid: Value for 'named-values' is invalid: Expected a map, but got a list | ||
# |
22 changes: 22 additions & 0 deletions
22
src/test/resources/bad-typings/inputs_list_with_null_separator.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
input-files: | ||
type: list | ||
separator: | ||
list-item: | ||
type: string | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'inputs_list_with_null_separator.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#• input-files: | ||
# \x1B[31m❌ INVALID: Separator must be specified.\x1B[0m | ||
# | ||
#Outputs: | ||
#None. | ||
# |
19 changes: 19 additions & 0 deletions
19
src/test/resources/bad-typings/inputs_with_non_string_type.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
permissions: | ||
type: 0x0 | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'inputs_with_non_string_type.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#• permissions: | ||
# \x1B[31m❌ INVALID: Unknown type: '0x0'.\x1B[0m | ||
# | ||
#Outputs: | ||
#None. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
permissions: | ||
type: | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'inputs_with_null_type.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#• permissions: | ||
# \x1B[31m❌ INVALID: Type must be specified. Use 'type' attribute.\x1B[0m | ||
# | ||
#Outputs: | ||
#None. | ||
# |
14 changes: 14 additions & 0 deletions
14
src/test/resources/bad-typings/outputs_enum_list_item_with_non_sequence_allowed_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
granted-scopes: | ||
type: list | ||
separator: ',' | ||
list-item: | ||
type: enum | ||
allowed-values: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'granted-scopes' is invalid: Value for 'list-item' is invalid: Value for 'allowed-values' is invalid: Expected a list, but got a scalar value | ||
# |
11 changes: 11 additions & 0 deletions
11
src/test/resources/bad-typings/outputs_enum_with_non_sequence_allowed_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
permissions: | ||
type: enum | ||
allowed-values: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'permissions' is invalid: Value for 'allowed-values' is invalid: Expected a list, but got a scalar value | ||
# |
14 changes: 14 additions & 0 deletions
14
src/test/resources/bad-typings/outputs_integer_list_item_with_non_mapping_named_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
list-of-integer: | ||
type: list | ||
separator: ',' | ||
list-item: | ||
type: integer | ||
named-values: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'list-of-integer' is invalid: Value for 'list-item' is invalid: Value for 'named-values' is invalid: Expected a map, but got a list | ||
# |
11 changes: 11 additions & 0 deletions
11
src/test/resources/bad-typings/outputs_integer_with_non_mapping_named_values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
retries: | ||
type: integer | ||
named-values: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'retries' is invalid: Value for 'named-values' is invalid: Expected a map, but got a list | ||
# |
22 changes: 22 additions & 0 deletions
22
src/test/resources/bad-typings/outputs_list_with_null_separator.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
input-files: | ||
type: list | ||
separator: | ||
list-item: | ||
type: string | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'outputs_list_with_null_separator.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#None. | ||
# | ||
#Outputs: | ||
#• input-files: | ||
# \x1B[31m❌ INVALID: Separator must be specified.\x1B[0m | ||
# |
20 changes: 20 additions & 0 deletions
20
src/test/resources/bad-typings/outputs_with_non_string_type.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
permissions: | ||
type: 0x0 | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'outputs_with_non_string_type.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#None. | ||
# | ||
#Outputs: | ||
#• permissions: | ||
# \x1B[31m❌ INVALID: Unknown type: '0x0'.\x1B[0m | ||
# | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
permissions: | ||
type: | ||
|
||
# Expected validation error | ||
# | ||
#For action with manifest at 'outputs_with_null_type.yml': | ||
#Result: | ||
#\x1B[31m❌ INVALID: Some typing is invalid.\x1B[0m | ||
# | ||
#Inputs: | ||
#None. | ||
# | ||
#Outputs: | ||
#• permissions: | ||
# \x1B[31m❌ INVALID: Type must be specified. Use 'type' attribute.\x1B[0m | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
foo: bar | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'foo' is invalid: Expected an object, but got a scalar value | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Expected a map, but got a scalar value | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
foo: bar | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'foo' is invalid: Expected an object, but got a scalar value | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: foo | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Expected a map, but got a scalar value | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: | ||
foo: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Value for 'foo' is invalid: Expected an object, but got a list | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
inputs: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'inputs' is invalid: Expected a map, but got a list | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: | ||
foo: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Value for 'foo' is invalid: Expected an object, but got a list | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
outputs: [] | ||
|
||
# Expected validation error | ||
# | ||
#Value for 'outputs' is invalid: Expected a map, but got a list | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
foo | ||
|
||
# Expected validation error | ||
# | ||
#Expected an object, but got a scalar value | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# yaml-language-server: $schema=../../../../github-actions-typing.schema.json | ||
# See https://github.com/typesafegithub/github-actions-typing | ||
[] | ||
|
||
# Expected validation error | ||
# | ||
#Expected an object, but got a list | ||
# |