|
1 |
| -name: Cloud Runner - K8s Tests |
| 1 | +name: Cloud Runner |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: { branches: [cloud-runner-develop] } |
| 4 | + push: { branches: [cloud-runner-develop, main] } |
5 | 5 | # push: { branches: [main] }
|
6 | 6 | # pull_request:
|
7 | 7 | # paths-ignore:
|
|
26 | 26 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
27 | 27 |
|
28 | 28 | jobs:
|
| 29 | + awsBuild: |
| 30 | + name: AWS Fargate Build |
| 31 | + if: github.event.pull_request.draft == false |
| 32 | + runs-on: ubuntu-latest |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + projectPath: |
| 37 | + - test-project |
| 38 | + unityVersion: |
| 39 | + # - 2019.2.11f1 |
| 40 | + - 2019.3.15f1 |
| 41 | + targetPlatform: |
| 42 | + #- StandaloneOSX # Build a macOS standalone (Intel 64-bit). |
| 43 | + - StandaloneWindows64 # Build a Windows 64-bit standalone. |
| 44 | + - StandaloneLinux64 # Build a Linux 64-bit standalone. |
| 45 | + - WebGL # WebGL. |
| 46 | + #- iOS # Build an iOS player. |
| 47 | + #- Android # Build an Android .apk. |
| 48 | + # - StandaloneWindows # Build a Windows standalone. |
| 49 | + # - WSAPlayer # Build an Windows Store Apps player. |
| 50 | + # - PS4 # Build a PS4 Standalone. |
| 51 | + # - XboxOne # Build a Xbox One Standalone. |
| 52 | + # - tvOS # Build to Apple's tvOS platform. |
| 53 | + # - Switch # Build a Nintendo Switch player |
| 54 | + # steps |
| 55 | + steps: |
| 56 | + - name: Checkout (default) |
| 57 | + uses: actions/checkout@v2 |
| 58 | + if: github.event.event_type != 'pull_request_target' |
| 59 | + with: |
| 60 | + lfs: true |
| 61 | + - name: Configure AWS Credentials |
| 62 | + uses: aws-actions/configure-aws-credentials@v1 |
| 63 | + with: |
| 64 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 65 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 66 | + aws-region: eu-west-2 |
| 67 | + - run: yarn |
| 68 | + - run: yarn run cli --help |
| 69 | + - run: yarn run test "caching" |
| 70 | + - run: yarn run test-i-aws |
| 71 | + env: |
| 72 | + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} |
| 73 | + PROJECT_PATH: ${{ matrix.projectPath }} |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + TARGET_PLATFORM: ${{ matrix.targetPlatform }} |
| 76 | + cloudRunnerTests: true |
| 77 | + versioning: None |
| 78 | + - uses: ./ |
| 79 | + id: aws-fargate-unity-build |
| 80 | + timeout-minutes: 25 |
| 81 | + with: |
| 82 | + cloudRunnerCluster: aws |
| 83 | + versioning: None |
| 84 | + projectPath: ${{ matrix.projectPath }} |
| 85 | + unityVersion: ${{ matrix.unityVersion }} |
| 86 | + targetPlatform: ${{ matrix.targetPlatform }} |
| 87 | + githubToken: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + postBuildSteps: | |
| 89 | + - name: upload |
| 90 | + image: amazon/aws-cli |
| 91 | + commands: | |
| 92 | + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default |
| 93 | + aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default |
| 94 | + aws configure set region $AWS_DEFAULT_REGION --profile default |
| 95 | + aws s3 ls |
| 96 | + aws s3 ls game-ci-test-storage |
| 97 | + ls /data/cache/$CACHE_KEY |
| 98 | + ls /data/cache/$CACHE_KEY/build |
| 99 | + aws s3 cp /data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar s3://game-ci-test-storage/$CACHE_KEY/build-$BUILD_GUID.tar |
| 100 | + secrets: |
| 101 | + - name: awsAccessKeyId |
| 102 | + value: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 103 | + - name: awsSecretAccessKey |
| 104 | + value: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 105 | + - name: awsDefaultRegion |
| 106 | + value: eu-west-2 |
| 107 | + - run: | |
| 108 | + aws s3 cp s3://game-ci-test-storage/${{ steps.aws-fargate-unity-build.outputs.CACHE_KEY }}/build-${{ steps.aws-fargate-unity-build.outputs.BUILD_GUID }}.tar build-${{ steps.aws-fargate-unity-build.outputs.BUILD_GUID }}.tar |
| 109 | + ls |
| 110 | + - run: yarn run cli -m aws-garbage-collect |
| 111 | + ########################### |
| 112 | + # Upload # |
| 113 | + ########################### |
| 114 | + # download from cloud storage |
| 115 | + - uses: actions/upload-artifact@v2 |
| 116 | + with: |
| 117 | + name: AWS Build (${{ matrix.targetPlatform }}) |
| 118 | + path: build-${{ steps.aws-fargate-unity-build.outputs.BUILD_GUID }}.tar |
| 119 | + retention-days: 14 |
29 | 120 | k8sBuilds:
|
30 | 121 | name: K8s (GKE Autopilot) build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
|
31 | 122 | runs-on: ubuntu-latest
|
@@ -105,7 +196,6 @@ jobs:
|
105 | 196 | aws s3 ls
|
106 | 197 | aws s3 ls game-ci-test-storage
|
107 | 198 | ls /data/cache/$CACHE_KEY
|
108 |
| - echo "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar s3://game-ci-test-storage/$CACHE_KEY/$BUILD_FILE" |
109 | 199 | aws s3 cp /data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar s3://game-ci-test-storage/$CACHE_KEY/build-$BUILD_GUID.tar
|
110 | 200 | secrets:
|
111 | 201 | - name: awsAccessKeyId
|
|
0 commit comments