mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00

* Update cloud-runner-aws-pipeline.yml * Update cloud-runner-k8s-pipeline.yml * yarn build * yarn build * correct branch ref * correct branch ref passed to target repo * Create k8s-tests.yml * Delete k8s-tests.yml * correct branch ref passed to target repo * correct branch ref passed to target repo * Always describe AWS tasks for now, because unstable error handling * Remove unused tree commands * Use lfs guid sum * Simple override cache push * Simple override cache push and pull override to allow pure cloud storage driven caching * Removal of early branch (breaks lfs caching) * Remove unused tree commands * Update action.yml * Update action.yml * Support cache and input override commands as input + full support custom hooks * Increase k8s timeout * replace filename being appended for unknclear reason * cache key should not contain whitespaces * Always try and deploy rook for k8s * Apply k8s files for rook * Update action.yml * Apply k8s files for rook * Apply k8s files for rook * cache test and action description for kuber storage class * Correct test and implement dependency health check and start * GCP-secret run, cache key * lfs smudge set explicit and undo explicit * Run using external secret provider to speed up input * Update cloud-runner-aws-pipeline.yml * Add nodejs as build step dependency * Add nodejs as build step dependency * Cloud Runner Tests must be specified to capture logs from cloud runner for tests * Cloud Runner Tests must be specified to capture logs from cloud runner for tests * Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs * Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs * Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs * Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs * Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs * better defaults for new inputs * better defaults * merge latest * force build update * use npm n to update node in unity builder * use npm n to update node in unity builder * use npm n to update node in unity builder * correct new line * quiet zipping * quiet zipping * default secrets for unity username and password * default secrets for unity username and password * ls active directory before lfs install * Get cloud runner secrets from * Get cloud runner secrets from * Cleanup setup of default secrets * Various fixes * Cleanup setup of default secrets * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * Various fixes * AWS secrets manager support * less caching logs * default k8s storage class to pd-standard * more readable build commands * Capture aws exit code 1 reliably * Always replace /head from branch * k8s default storage class to standard-rwo * cleanup * further cleanup input * further cleanup input * further cleanup input * further cleanup input * further cleanup input * folder sizes to inspect caching * dir command for local cloud runner test * k8s wait for pending because pvc will not create earlier * prefer k8s standard storage * handle empty string as cloud runner cluster input * local-system is now used for cloud runner test implementation AND correctly unset test CLI input * local-system is now used for cloud runner test implementation AND correctly unset test CLI input * fix unterminated quote * fix unterminated quote * do not share build parameters in tests - in cloud runner this will cause conflicts with resouces of the same name * remove head and heads from branch prefix * fix reversed caching direction of cache-push * fixes * fixes * fixes * cachePull cli * fixes * fixes * fixes * fixes * fixes * order cache test to be first * order cache test to be first * fixes * populate cache key instead of using branch * cleanup cli * garbage-collect-aws cli can iterate over aws resources and cli scans all ts files * import cli methods * import cli files explicitly * import cli files explicitly * import cli files explicitly * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * import cli methods * log parameters in cloud runner parameter test * log parameters in cloud runner parameter test * log parameters in cloud runner parameter test * Cloud runner param test before caching because we have a fast local cache test now * Using custom build path relative to repo root rather than project root * aws-garbage-collect at end of pipeline * aws-garbage-collect do not actually delete anything for now - just list * remove some legacy du commands * Update cloud-runner-aws-pipeline.yml * log contents after cache pull and fix some scenarios with duplicate secrets * log contents after cache pull and fix some scenarios with duplicate secrets * log contents after cache pull and fix some scenarios with duplicate secrets * PR comments * Replace guid with uuid package * use fileExists lambda instead of stat to check file exists in caching * build failed results in core error message * Delete sample.txt
129 lines
4.8 KiB
YAML
129 lines
4.8 KiB
YAML
name: Cloud Runner - K8s Tests
|
|
|
|
on:
|
|
push: { branches: [cloud-runner-develop] }
|
|
# push: { branches: [main] }
|
|
# pull_request:
|
|
# paths-ignore:
|
|
# - '.github/**'
|
|
|
|
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_TESTS: true
|
|
DEBUG: true
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
|
|
jobs:
|
|
k8sBuilds:
|
|
name: K8s (GKE Autopilot) build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
unityVersion:
|
|
# - 2019.2.11f1
|
|
- 2019.3.15f1
|
|
targetPlatform:
|
|
# - StandaloneWindows64
|
|
- StandaloneLinux64
|
|
steps:
|
|
###########################
|
|
# Checkout #
|
|
###########################
|
|
- uses: actions/checkout@v2
|
|
if: github.event.event_type != 'pull_request_target'
|
|
with:
|
|
lfs: true
|
|
|
|
###########################
|
|
# Setup #
|
|
###########################
|
|
- uses: google-github-actions/setup-gcloud@v0
|
|
with:
|
|
version: '288.0.0'
|
|
service_account_email: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_EMAIL }}
|
|
service_account_key: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
|
|
- name: Get GKE cluster credentials
|
|
run: gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
|
|
|
|
###########################
|
|
# Cloud Runner Test Suite #
|
|
###########################
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12.x
|
|
- run: yarn
|
|
- run: yarn run cli --help
|
|
- run: yarn run test "caching"
|
|
- name: Cloud Runner Test Suite
|
|
run: yarn run test-i-k8s --detectOpenHandles --forceExit
|
|
env:
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
PROJECT_PATH: ${{ matrix.projectPath }}
|
|
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
KUBE_CONFIG: ${{ steps.read-base64.outputs.base64 }}
|
|
unityVersion: ${{ matrix.unityVersion }}
|
|
cloudRunnerTests: true
|
|
versioning: None
|
|
|
|
###########################
|
|
# Cloud Runner Build Test #
|
|
###########################
|
|
- name: Cloud Runner Build Test
|
|
uses: ./
|
|
id: k8s-unity-build
|
|
timeout-minutes: 30
|
|
with:
|
|
cloudRunnerCluster: k8s
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
targetPlatform: ${{ matrix.targetPlatform }}
|
|
kubeConfig: ${{ steps.read-base64.outputs.base64 }}
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
projectPath: test-project
|
|
unityVersion: ${{ matrix.unityVersion }}
|
|
versioning: None
|
|
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/$CACHE_KEY
|
|
echo "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.zip s3://game-ci-test-storage/$CACHE_KEY/$BUILD_FILE"
|
|
aws s3 cp /data/cache/$CACHE_KEY/build/build-$BUILD_GUID.zip s3://game-ci-test-storage/$CACHE_KEY/build-$BUILD_GUID.zip
|
|
secrets:
|
|
- name: awsAccessKeyId
|
|
value: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
- name: awsSecretAccessKey
|
|
value: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
- name: awsDefaultRegion
|
|
value: eu-west-2
|
|
- run: |
|
|
aws s3 cp s3://game-ci-test-storage/${{ steps.k8s-unity-build.outputs.CACHE_KEY }}/build-${{ steps.k8s-unity-build.outputs.BUILD_GUID }}.zip build-${{ steps.k8s-unity-build.outputs.BUILD_GUID }}.zip
|
|
ls
|
|
###########################
|
|
# Upload #
|
|
###########################
|
|
# download from cloud storage
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: K8s Build (${{ matrix.targetPlatform }})
|
|
path: build-${{ steps.k8s-unity-build.outputs.BUILD_GUID }}.zip
|
|
retention-days: 14
|