Skip to content

Commit

Permalink
Merge branch 'main' into peek-fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Mordil committed Jan 3, 2024
2 parents fae9f13 + 7e28eb7 commit a4c3707
Show file tree
Hide file tree
Showing 4,114 changed files with 1,191 additions and 913,504 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
301 changes: 10 additions & 291 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,296 +1,15 @@
version: 2.1

parameters:
resource_class:
type: string
default: "macos.x86.medium.gen2"
xcode_version:
type: string
default: "14.3.1"
ios_current_version:
type: string
default: "16.4"
ios_previous_version:
type: string
default: "15.5"
macos_version: # The user-facing version string for macOS builds
type: string
default: "13.2"
tvos_version: # The user-facing version string of tvOS builds
type: string
default: "16.4"

commands:
integration_test_setup:
steps:
- restore_cache:
key: starwars-server
- restore_cache:
key: apollo-server-graphql-transport-ws
- common_test_setup
- run:
command: ./scripts/install-node-v12.sh
name: Install Node
- run:
command: ./scripts/install-or-update-starwars-server.sh
name: Install/Update StarWars Server
- run:
command: cd ../starwars-server && npm start
name: Start StarWars Server
background: true
- run:
command: cd SimpleUploadServer && nvm use && npm install && npm start
name: Start Upload Server
background: true
- run:
command: sudo chmod -R +rwx SimpleUploadServer
name: Adjust permissions for simple upload server folder
- run:
command: ./scripts/install-apollo-server-docs-example-server.sh
name: Install Apollo Server (graphql-transport-ws configuration)
- run:
command: cd ../docs-examples/apollo-server/v3/subscriptions-graphql-ws && npm start
name: Start Apollo Server (graphql-transport-ws configuration)
background: true
integration_test_cleanup:
steps:
- save_cache:
key: starwars-server
paths:
- ../starwars-server
- save_cache:
key: apollo-server-graphql-transport-ws
paths:
- ../docs-examples/apollo-server/v3/subscriptions-graphql-ws
common_test_setup:
description: Commands to run for setup of every set of tests
steps:
- checkout
- run:
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install xcbeautify
name: Install xcbeautify
build_and_run_xcode_tests:
steps:
- run:
command: xcodebuild clean test -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcbeautify
name: Clean, build and run Xcode tests
- save-xcodebuild-artifacts
run_js_tests:
steps:
- run:
command: npm install && npm test
name: Run JS frontend tests
working_directory: Sources/ApolloCodegenLib/Frontend/JavaScript/
cocoapods_install_test:
steps:
- run:
working_directory: Tests/CodegenCLITests/pod-install-test/
command: pod install --verbose
name: CocoaPods - Install
- run:
working_directory: Tests/CodegenCLITests/pod-install-test/
command: ./Pods/Apollo/apollo-ios-cli init --schema-name NewTestSchema --module-type other
name: CocoaPods - CLI Test (init)
- run:
working_directory: Tests/CodegenCLITests/pod-install-test/
command: ./Pods/Apollo/apollo-ios-cli generate
name: CocoaPods - CLI Test (generate)
save-xcodebuild-artifacts:
description: Save artifacts logs, crash reports and test results generated by xcodebuild
steps:
- store_artifacts:
name: Save xcodebuild logs
path: logs
destination: logs
- store_artifacts:
name: Save crash logs
path: ~/Library/Logs/DiagnosticReports/
destination: crashes
- run:
name: Zip result bundle
working_directory: ~/TestResults
command: zip -r ResultBundle.zip ResultBundle.xcresult
when: always
- store_artifacts:
name: Save test results
path: ~/TestResults/ResultBundle.zip
destination: results
codegen_test_configurations_generate_and_test:
steps:
- run:
command: |
if [[ ! -z "${CIRCLE_PR_REPONAME}" ]]; then
git clone "https://github.com/$CIRCLE_PR_USERNAME/$CIRCLE_PR_REPONAME.git" apollo-ios
cd apollo-ios
git checkout $CIRCLE_SHA1
else
git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL"
fi
name: Manually clone Apollo iOS repository
- run:
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install xcbeautify
name: Install xcbeautify
- run:
working_directory: apollo-ios/
command: ./scripts/run-test-codegen-configurations.sh -t
name: Generate and Test Codegen Configurations


# Important! When adding a new job to `jobs`, make sure to define when it
# executes by also adding it to the `workflows` section below!
jobs:
Swift_Build:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
steps:
- common_test_setup
- run:
command: swift build

XCFramework_Build:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
steps:
- common_test_setup
- run:
name: Build XCArchive (iOS Simulator)
command: xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS Simulator' -archivePath "./build/iphonesimulator.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
- run:
name: Build XCArchive (iOS)
command: xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS' -archivePath "./build/iphoneos.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
- run:
name: Build XCFramework
command: xcodebuild -create-xcframework -output ./build/Apollo.xcframework -framework ./build/iphonesimulator.xcarchive/Products/@rpath/Apollo.framework -framework ./build/iphoneos.xcarchive/Products/@rpath/Apollo.framework

IntegrationTests_macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=macOS,arch=x86_64
CIRCLE_XCODE_SCHEME: Apollo
CIRCLE_XCODE_TEST_PLAN: Apollo-IntegrationTestPlan
steps:
- integration_test_setup
- build_and_run_xcode_tests
- integration_test_cleanup

macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=macOS,arch=x86_64
CIRCLE_XCODE_SCHEME: Apollo
CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests

iOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_current_version >>,name=iPhone 14
CIRCLE_XCODE_SCHEME: Apollo
CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests

iOS_previous:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_previous_version >>,name=iPhone 13
CIRCLE_XCODE_SCHEME: Apollo
CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests

tvOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=tvOS Simulator,OS=<< pipeline.parameters.tvos_version >>,name=Apple TV
CIRCLE_XCODE_SCHEME: Apollo
CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests

CodegenLib_macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=macOS,arch=x86_64
CIRCLE_XCODE_SCHEME: ApolloCodegenLib
CIRCLE_XCODE_TEST_PLAN: Apollo-Codegen-CITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests
- run_js_tests

CodegenCLI_macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=macOS,arch=x86_64
CIRCLE_XCODE_SCHEME: CodegenCLI
CIRCLE_XCODE_TEST_PLAN: CodegenCLITestPlan
steps:
- common_test_setup
- build_and_run_xcode_tests

CocoaPodsIntegration_macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
environment:
DESTINATION: platform=macOS,arch=x86_64
steps:
- common_test_setup
- cocoapods_install_test

CodegenTestConfigurations_macOS_current:
resource_class: << pipeline.parameters.resource_class >>
macos:
xcode: << pipeline.parameters.xcode_version >>
steps:
- codegen_test_configurations_generate_and_test
orbs:
secops: apollo/[email protected]

workflows:
version: 2
# This workflow builds and tests the library across various operating systems and versions
build-and-test:
security-scans:
jobs:
- Swift_Build:
name: Build as Swift package
- XCFramework_Build:
name: Build XCFramework
- IntegrationTests_macOS_current:
name: Apollo Integration Tests - macOS << pipeline.parameters.macos_version >>
- macOS_current:
name: Apollo Unit Tests - macOS << pipeline.parameters.macos_version >>
- iOS_current:
name: Apollo Unit Tests - iOS << pipeline.parameters.ios_current_version >>
- iOS_previous:
name: Apollo Unit Tests - iOS << pipeline.parameters.ios_previous_version >>
- tvOS_current:
name: Apollo Unit Tests - tvOS << pipeline.parameters.tvos_version >>
- CodegenLib_macOS_current:
name: Codegen Lib Unit Tests - macOS << pipeline.parameters.macos_version >>
- CodegenCLI_macOS_current:
name: Codegen CLI Unit Tests - macOS << pipeline.parameters.macos_version >>
- CocoaPodsIntegration_macOS_current:
name: CocoaPods Integration Tests - macOS << pipeline.parameters.macos_version >>
- CodegenTestConfigurations_macOS_current:
name: Codegen Test Configurations - macOS << pipeline.parameters.macos_version >>
- secops/gitleaks:
context:
- platform-docker-ro
- github-orb
- secops-oidc
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
git-revision: << pipeline.git.revision >>
17 changes: 0 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE/pull-request-template-release.md

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/docs-publish.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Close Pull Request

on:
pull_request_target:
types: [opened]

jobs:
run:
name: Close and Comment PR
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "We do not accept PRs directly to the 'apollo-ios' repo. All development is done through the 'apollo-ios-dev' repo, please see the CONTRIBUTING guide for more information."
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ xcuserdata/
*.xcscmblueprint
.DS_Store

## Visual Studio Code
.vscode/launch.json

## Obj-C/Swift specific
*.hmap
*.ipa
Expand Down
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

Loading

0 comments on commit a4c3707

Please sign in to comment.