140 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			140 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			YAML
		
	
	
| name: Cloud Runner CI Pipeline
 | |
| 
 | |
| on:
 | |
|   push: { branches: [cloud-runner-develop, cloud-runner-preview, main] }
 | |
|   workflow_dispatch:
 | |
| 
 | |
| env:
 | |
|   GKE_ZONE: 'us-central1'
 | |
|   GKE_REGION: 'us-central1'
 | |
|   GKE_PROJECT: 'unitykubernetesbuilder'
 | |
|   GKE_CLUSTER: 'game-ci-github-pipelines'
 | |
|   GCP_LOGGING: true
 | |
|   GCP_PROJECT: unitykubernetesbuilder
 | |
|   GCP_LOG_FILE: ${{ github.workspace }}/cloud-runner-logs.txt
 | |
|   AWS_REGION: eu-west-2
 | |
|   AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|   AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|   AWS_DEFAULT_REGION: eu-west-2
 | |
|   AWS_BASE_STACK_NAME: game-ci-github-pipelines
 | |
|   CLOUD_RUNNER_BRANCH: ${{ github.ref }}
 | |
|   CLOUD_RUNNER_DEBUG: true
 | |
|   CLOUD_RUNNER_DEBUG_TREE: true
 | |
|   DEBUG: true
 | |
|   UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|   PROJECT_PATH: test-project
 | |
|   UNITY_VERSION: 2019.3.15f1
 | |
|   USE_IL2CPP: false
 | |
|   RUN_ALL:
 | |
| 
 | |
| jobs:
 | |
|   integrationTests:
 | |
|     name: Integration Tests
 | |
|     if: github.event.event_type != 'pull_request_target'
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         cloudRunnerCluster:
 | |
|           - aws
 | |
|           - local-docker
 | |
|           - k8s
 | |
|     steps:
 | |
|       - name: Checkout (default)
 | |
|         uses: actions/checkout@v2
 | |
|         with:
 | |
|           lfs: false
 | |
|       - uses: google-github-actions/auth@v1
 | |
|         with:
 | |
|           credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
 | |
|       - name: Get GKE cluster credentials
 | |
|         run: gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
 | |
|       - name: Configure AWS Credentials
 | |
|         uses: aws-actions/configure-aws-credentials@v1
 | |
|         with:
 | |
|           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|           aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|           aws-region: eu-west-2
 | |
|       - run: yarn
 | |
|       - run: yarn run cli --help
 | |
|       - run: yarn run test "cloud-runner-async-workflow" --detectOpenHandles --forceExit --runInBand
 | |
|         if: matrix.CloudRunnerCluster == 'aws'
 | |
|         timeout-minutes: 180
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|           PROJECT_PATH: test-project
 | |
|           GIT_PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|           TARGET_PLATFORM: StandaloneWindows64
 | |
|           cloudRunnerTests: true
 | |
|           versioning: None
 | |
|           CLOUD_RUNNER_CLUSTER: ${{ matrix.cloudRunnerCluster }}
 | |
|           AWS_BASE_STACK_NAME: game-ci-github-pipelines
 | |
|           CHECKS_API_TOKEN: ${{ secrets.CHECKS_API_TOKEN }}
 | |
|       - run: yarn run test "cloud-runner-run-twice-retaining" --detectOpenHandles --forceExit --runInBand
 | |
|         if: matrix.CloudRunnerCluster == 'aws' || matrix.CloudRunnerCluster == 'k8s'
 | |
|         timeout-minutes: 180
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|           PROJECT_PATH: test-project
 | |
|           GIT_PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|           TARGET_PLATFORM: StandaloneWindows64
 | |
|           cloudRunnerTests: true
 | |
|           versioning: None
 | |
|           CLOUD_RUNNER_CLUSTER: ${{ matrix.cloudRunnerCluster }}
 | |
|           AWS_BASE_STACK_NAME: game-ci-github-pipelines
 | |
|       - run: yarn run test-i --detectOpenHandles --forceExit --runInBand
 | |
|         if: matrix.CloudRunnerCluster == 'local-docker'
 | |
|         timeout-minutes: 180
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|           PROJECT_PATH: test-project
 | |
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|           TARGET_PLATFORM: StandaloneWindows64
 | |
|           cloudRunnerTests: true
 | |
|           versioning: None
 | |
|           CLOUD_RUNNER_CLUSTER: ${{ matrix.cloudRunnerCluster }}
 | |
|           AWS_BASE_STACK_NAME: game-ci-github-pipelines
 | |
|   localBuildTests:
 | |
|     name: Local Build Target Tests
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         cloudRunnerCluster:
 | |
|           #- aws
 | |
|           - local-docker
 | |
|           #- k8s
 | |
|         targetPlatform:
 | |
|           - StandaloneOSX # Build a macOS standalone (Intel 64-bit).
 | |
|           - StandaloneWindows64 # Build a Windows 64-bit standalone.
 | |
|           - StandaloneLinux64 # Build a Linux 64-bit standalone.
 | |
|           - WebGL # WebGL.
 | |
|           - iOS # Build an iOS player.
 | |
|           - Android # Build an Android .apk.
 | |
|     steps:
 | |
|       - name: Checkout (default)
 | |
|         uses: actions/checkout@v2
 | |
|         with:
 | |
|           lfs: false
 | |
|       - run: yarn
 | |
|       - uses: ./
 | |
|         id: unity-build
 | |
|         timeout-minutes: 90
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|         with:
 | |
|           cloudRunnerTests: true
 | |
|           versioning: None
 | |
|           projectPath: test-project
 | |
|           gitPrivateToken: ${{ secrets.GITHUB_TOKEN }}
 | |
|           targetPlatform: ${{ matrix.targetPlatform }}
 | |
|           cloudRunnerCluster: ${{ matrix.cloudRunnerCluster }}
 | |
|       - run: |
 | |
|           tree ./cloud-runner-cache
 | |
|           cp ./cloud-runner-cache/cache/${{ steps.unity-build.outputs.CACHE_KEY }}/build/${{ steps.unity-build.outputs.BUILD_ARTIFACT }} ${{ steps.unity-build.outputs.BUILD_ARTIFACT }}          
 | |
|       - uses: actions/upload-artifact@v2
 | |
|         with:
 | |
|           name: ${{ matrix.cloudRunnerCluster }} Build (${{ matrix.targetPlatform }})
 | |
|           path: ${{ steps.unity-build.outputs.BUILD_ARTIFACT }}
 | |
|           retention-days: 14
 |