112 lines
4.1 KiB
YAML
112 lines
4.1 KiB
YAML
name: cloud-runner-integrity-localstack
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
runGithubIntegrationTests:
|
|
description: 'Run GitHub Checks integration tests'
|
|
required: false
|
|
default: 'false'
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
checks: write
|
|
statuses: write
|
|
|
|
env:
|
|
AWS_REGION: us-east-1
|
|
AWS_DEFAULT_REGION: us-east-1
|
|
AWS_STACK_NAME: game-ci-local
|
|
AWS_ENDPOINT: http://localhost:4566
|
|
AWS_ENDPOINT_URL: http://localhost:4566
|
|
AWS_ACCESS_KEY_ID: test
|
|
AWS_SECRET_ACCESS_KEY: test
|
|
AWS_FORCE_PROVIDER: aws
|
|
CLOUD_RUNNER_BRANCH: ${{ github.ref }}
|
|
DEBUG: true
|
|
PROJECT_PATH: test-project
|
|
USE_IL2CPP: false
|
|
|
|
jobs:
|
|
tests:
|
|
name: Cloud Runner Tests (LocalStack)
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
localstack:
|
|
image: localstack/localstack
|
|
ports:
|
|
- 4566:4566
|
|
env:
|
|
SERVICES: cloudformation,ecs,kinesis,cloudwatch,s3,logs
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
test:
|
|
- 'cloud-runner-end2end-locking'
|
|
- 'cloud-runner-end2end-caching'
|
|
- 'cloud-runner-end2end-retaining'
|
|
- 'cloud-runner-caching'
|
|
- 'cloud-runner-environment'
|
|
- 'cloud-runner-image'
|
|
- 'cloud-runner-hooks'
|
|
- 'cloud-runner-local-persistence'
|
|
- 'cloud-runner-locking-core'
|
|
- 'cloud-runner-locking-get-locked'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
lfs: false
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'yarn'
|
|
- name: Verify LocalStack is running and accessible
|
|
run: |
|
|
echo "Verifying LocalStack services are available..."
|
|
# Wait for LocalStack to be ready
|
|
for i in {1..30}; do
|
|
if curl -s http://localhost:4566/_localstack/health | grep -q '"services":'; then
|
|
echo "LocalStack is ready"
|
|
curl -s http://localhost:4566/_localstack/health | jq '.' || curl -s http://localhost:4566/_localstack/health
|
|
break
|
|
fi
|
|
echo "Waiting for LocalStack... ($i/30)"
|
|
sleep 2
|
|
done
|
|
# Verify required AWS services are available
|
|
echo "Verifying required AWS services (cloudformation,ecs,kinesis,cloudwatch,s3,logs)..."
|
|
curl -s http://localhost:4566/_localstack/health | grep -q 'cloudformation' || echo "WARNING: CloudFormation service may not be available"
|
|
curl -s http://localhost:4566/_localstack/health | grep -q 'ecs' || echo "WARNING: ECS service may not be available"
|
|
curl -s http://localhost:4566/_localstack/health | grep -q 'kinesis' || echo "WARNING: Kinesis service may not be available"
|
|
- run: yarn install --frozen-lockfile
|
|
- name: Validate AWS provider configuration
|
|
run: |
|
|
echo "Validating AWS provider configuration for LocalStack tests..."
|
|
echo "PROVIDER_STRATEGY: aws"
|
|
echo "AWS_FORCE_PROVIDER: ${{ env.AWS_FORCE_PROVIDER }}"
|
|
echo "AWS_ENDPOINT: ${{ env.AWS_ENDPOINT }}"
|
|
echo ""
|
|
echo "✓ Configuration validated: AWS provider will be used with LocalStack to validate AWS functionality"
|
|
echo "✓ This ensures ECS, CloudFormation, Kinesis, and other AWS services are properly tested"
|
|
echo "✓ AWS_FORCE_PROVIDER prevents automatic fallback to local-docker"
|
|
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
|
|
timeout-minutes: 60
|
|
env:
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
|
|
PROJECT_PATH: test-project
|
|
TARGET_PLATFORM: StandaloneWindows64
|
|
cloudRunnerTests: true
|
|
versioning: None
|
|
KUBE_STORAGE_CLASS: local-path
|
|
PROVIDER_STRATEGY: aws
|
|
AWS_FORCE_PROVIDER: aws
|
|
AWS_ACCESS_KEY_ID: test
|
|
AWS_SECRET_ACCESS_KEY: test
|
|
AWS_ENDPOINT: http://localhost:4566
|
|
AWS_ENDPOINT_URL: http://localhost:4566
|
|
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|