iOS app build is failing in build server

I have integrated Apollo iOS sdk using pods. sdk v 1.11.0
I have setup everything as per the docs and generated the code and build is succeeding in my local machine.
However, after pushing the changes to repository build is failing with number of errors. Added below few error lines from the build job.

Copying Apollo-umbrella.h
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift:60:27:
variable binding in a condition requires an initializer
guard let transaction else {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/ApolloAPI/CacheKeyInfo.swift:101:52:
expected ‘:’ following argument label and parameter name
@inlinable public init(jsonValue: (any ScalarType)?, uniqueKeyGroup: String? = nil) throws {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/ApolloAPI/CacheKeyInfo.swift:101:52:
expected type
@inlinable public init(jsonValue: (any ScalarType)?, uniqueKeyGroup: String? = nil) throws {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/ApolloAPI/DataDict.swift:111:62:
expected ‘]’ in array type
@usableFromInline func fragmentsAreFulfilled(_ types: [any SelectionSet.Type]) → Bool {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/Apollo/DefaultInterceptorProvider.swift:34:13:
expected ‘]’ in array type
) → [any ApolloInterceptor] {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/Apollo/DefaultInterceptorProvider.swift:34:12:
consecutive declarations on a line must be separated by ‘;’
) → [any ApolloInterceptor] {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/Apollo/DefaultInterceptorProvider.swift:34:13:
expected declaration
) → [any ApolloInterceptor] {
^
:x:
/Users/XXXXXXXXX/Pods/Apollo/Sources/Apollo/FieldSelectionCollector.swift:41:33:
protocols do not allow generic parameters; use associated types instead
protocol FieldSelectionCollector {

Can someone please help.

Hi there @Anil. It looks to me like your CI machine is trying to build using an older version of the Swift language. Please make sure the your CI machine is using Swift 5.10 (the latest released version to build).