120 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			120 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			YAML
		
	
	
| name: Cloud Runner - AWS Tests
 | |
| 
 | |
| on:
 | |
|   push: { branches: [main, aws, remote-builder/unified-providers] }
 | |
| 
 | |
| env:
 | |
|   AWS_REGION: 'eu-west-1'
 | |
| 
 | |
| jobs:
 | |
|   buildForAllPlatforms:
 | |
|     name: AWS Fargate Build
 | |
|     if: github.event.pull_request.draft == false
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         projectPath:
 | |
|           - test-project
 | |
|         unityVersion:
 | |
|           #  - 2019.2.11f1
 | |
|           - 2019.3.15f1
 | |
|         targetPlatform:
 | |
|           #- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
 | |
|           #- StandaloneWindows64 # Build a Windows 64-bit standalone.
 | |
|           - StandaloneLinux64 # Build a Linux 64-bit standalone.
 | |
|           #- iOS # Build an iOS player.
 | |
|           #- Android # Build an Android .apk.
 | |
|           #- WebGL # WebGL.
 | |
|           #          - StandaloneWindows # Build a Windows standalone.
 | |
|           #          - WSAPlayer # Build an Windows Store Apps player.
 | |
|           #          - PS4 # Build a PS4 Standalone.
 | |
|           #          - XboxOne # Build a Xbox One Standalone.
 | |
|           #          - tvOS # Build to Apple's tvOS platform.
 | |
|           #          - Switch # Build a Nintendo Switch player
 | |
|     # steps
 | |
|     steps:
 | |
|       - name: Checkout (default)
 | |
|         uses: actions/checkout@v2
 | |
|         if: github.event.event_type != 'pull_request_target'
 | |
|         with:
 | |
|           lfs: true
 | |
|       - 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
 | |
|       - uses: actions/setup-node@v2
 | |
|         with:
 | |
|           node-version: 12.x
 | |
|       - run: yarn
 | |
|       - run: yarn run cli --help
 | |
|       - run: yarn run test-i-aws
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|           AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|           AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|           AWS_DEFAULT_REGION: eu-west-2
 | |
|           DEBUG: true
 | |
|           CLOUD_RUNNER_BRANCH: remote-builder/unified-providers
 | |
|           PROJECT_PATH: ${{ matrix.projectPath }}
 | |
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|           AWS_BASE_STACK_NAME: game-ci-stack-integration-tests
 | |
|       - uses: ./
 | |
|         id: aws-fargate-unity-build
 | |
|         env:
 | |
|           UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
 | |
|           AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|           AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|           AWS_DEFAULT_REGION: eu-west-2
 | |
|           DEBUG: true
 | |
|           EXPERIMENTAL_HOOK: |
 | |
|             - name: FUSE filesystem to s3 for global scale caching
 | |
|               image: amazon/aws-cli
 | |
|               commands: |
 | |
|                 sudo amazon-linux-extras install epel
 | |
|                 sudo yum install s3fs-fuse
 | |
|                 aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default
 | |
|                 aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default
 | |
|                 aws configure set region $AWS_DEFAULT_REGION --profile default
 | |
|                 echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ${HOME}/.passwd-s3fs
 | |
|                 chmod 600 ${HOME}/.passwd-s3fs
 | |
|                 s3fs game-ci-test-storage /data/cache -o passwd_file=${HOME}/.passwd-s3fs
 | |
|               secrets:
 | |
|               - name: awsAccessKeyId
 | |
|                 value: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|               - name: awsSecretAccessKey
 | |
|                 value: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|               - name: awsDefaultRegion
 | |
|                 value: eu-west-2            
 | |
|         with:
 | |
|           cloudRunnerCluster: aws
 | |
|           versioning: None
 | |
|           projectPath: ${{ matrix.projectPath }}
 | |
|           unityVersion: ${{ matrix.unityVersion }}
 | |
|           targetPlatform: ${{ matrix.targetPlatform }}
 | |
|           githubToken: ${{ secrets.GITHUB_TOKEN }}
 | |
|           awsBaseStackName: game-ci-stack-integration-tests
 | |
|           CloudRunnerBranch: remote-builder/unified-providers
 | |
|           cloudRunnerTests: true
 | |
|           postBuildSteps: |
 | |
|             - name: upload
 | |
|               image: amazon/aws-cli
 | |
|               commands: |
 | |
|                 aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default
 | |
|                 aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default
 | |
|                 aws configure set region $AWS_DEFAULT_REGION --profile default
 | |
|                 aws s3 ls
 | |
|                 aws s3 ls game-ci-test-storage
 | |
|                 ls /data/cache/$BUILD_GUID
 | |
|                 echo "/data/cache/$BUILD_GUID/build-$BUILD_GUID.zip s3://game-ci-test-storage/$BUILD_PATH/$BUILD_FILE"
 | |
|                 aws s3 cp /data/cache/$BUILD_GUID/build-$BUILD_GUID.zip s3://game-ci-test-storage/$BUILD_PATH/$BUILD_FILE
 | |
|               secrets:
 | |
|               - name: awsAccessKeyId
 | |
|                 value: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | |
|               - name: awsSecretAccessKey
 | |
|                 value: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | |
|               - name: awsDefaultRegion
 | |
|                 value: eu-west-2            
 |