Skip to content

Commit

Permalink
fix: remove deprecated class (#302)
Browse files Browse the repository at this point in the history
Co-authored-by: abdelDriowya <[email protected]>
  • Loading branch information
kira-m and abdelDriowya authored Jul 12, 2024
1 parent 3e700f0 commit 8247a72
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
11 changes: 2 additions & 9 deletions pkg/parser/validate/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ func (val Validate) ValidateExecutors() {
// MacOSExecutor

func (val Validate) validateMacOSExecutor(executor ast.MacOSExecutor) {
if slices.Contains(utils.ValidXcodeAppleSiliconVersions, executor.Xcode) {
if slices.Contains(utils.ValidXcodeVersions, executor.Xcode) {
val.checkIfValidResourceClass(
executor.ResourceClass,
utils.ValidMacOSAppleSiliconResourceClasses,
executor.ResourceClassRange,
fmt.Sprintf("Xcode version \"%s\"", executor.Xcode),
)
} else if slices.Contains(utils.ValidXcodeIntelVersions, executor.Xcode) {
val.checkIfValidResourceClass(
executor.ResourceClass,
utils.ValidMacOSIntelResourceClasses,
utils.ValidMacOSResourceClasses,
executor.ResourceClassRange,
fmt.Sprintf("Xcode version \"%s\"", executor.Xcode),
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/validate/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestResourceClass(t *testing.T) {
yamlData: `jobs:
test:
macos:
xcode: ` + utils.ValidXcodeAppleSiliconVersions[0] + `
xcode: ` + utils.ValidXcodeVersions[0] + `
resource_class: toto
steps:
- checkout`,
Expand Down
27 changes: 3 additions & 24 deletions pkg/utils/executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,8 @@ var ValidMachinePairs = []struct {
{Images: ValidWindowsGPUImages, ResourceClasses: ValidWindowsGPUResourceClasses},
}

var ValidXcodeIntelVersions = []string{
"15.3.0",
"15.2.0",
"15.1.0",
"15.0.0",
"14.3.1",
"14.2.0",
"14.1.0",
"14.0.1",
"13.4.1",
"12.5.1",
}

var ValidMacOSIntelResourceClasses = []string{
"macos.x86.medium.gen2",
}

var ValidXcodeAppleSiliconVersions = []string{
var ValidXcodeVersions = []string{
"16.0.0",
"15.4.0",
"15.3.0",
"15.2.0",
Expand All @@ -214,16 +198,11 @@ var ValidXcodeAppleSiliconVersions = []string{
"13.4.1",
}

var ValidMacOSAppleSiliconResourceClasses = []string{
var ValidMacOSResourceClasses = []string{
"macos.m1.medium.gen1",
"macos.m1.large.gen1",
}

var ValidMacOSResourceClasses = slices.Concat(
ValidMacOSAppleSiliconResourceClasses,
ValidMacOSIntelResourceClasses,
)

var ValidDockerResourceClasses = ValidLinuxResourceClasses

func IsSelfHostedRunner(resourceClass string) bool {
Expand Down
1 change: 0 additions & 1 deletion publicschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@
"gpu.nvidia.small",
"gpu.nvidia.medium",
"windows.gpu.nvidia.medium",
"macos.x86.medium.gen2",
"macos.m1.medium.gen1",
"macos.m1.large.gen1"
]
Expand Down

0 comments on commit 8247a72

Please sign in to comment.