Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Smoke

on:
pull_request:
push:
branches: [main]

jobs:
smoke:
name: PlayMode smoke vs sdk_demo_backend
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- name: Check out asobi-unity (as embedded package)
uses: actions/checkout@v4
with:
path: _unity_project/Packages/com.asobi.sdk

- name: Check out sdk_demo_backend
uses: actions/checkout@v4
with:
repository: widgrensit/sdk_demo_backend
path: _backend

- name: Bring up sdk_demo_backend
run: docker compose up -d
working-directory: _backend

- name: Wait for backend
run: |
for i in $(seq 1 60); do
code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H 'content-type: application/json' \
-d '{}' http://localhost:8084/api/v1/auth/register || echo 000)
if [ "$code" != "000" ] && [ "$code" -lt 500 ]; then
echo "Backend reachable (HTTP $code)"
exit 0
fi
sleep 1
done
echo "Backend never became reachable"
exit 1

- name: Scaffold minimal Unity project
run: |
mkdir -p _unity_project/Assets _unity_project/ProjectSettings
cat > _unity_project/Packages/manifest.json <<'EOF'
{
"dependencies": {
"com.asobi.sdk": "file:com.asobi.sdk",
"com.unity.test-framework": "1.4.5",
"com.unity.ugui": "1.0.0"
},
"testables": [
"com.asobi.sdk"
]
}
EOF
cat > _unity_project/ProjectSettings/ProjectVersion.txt <<'EOF'
m_EditorVersion: 2022.3.50f1
EOF

- name: Cache Unity Library
uses: actions/cache@v4
with:
path: _unity_project/Library
key: Library-${{ hashFiles('_unity_project/Packages/manifest.json', '_unity_project/Packages/com.asobi.sdk/**') }}
restore-keys: |
Library-

- name: Run PlayMode tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
ASOBI_URL: http://localhost:8084
with:
projectPath: _unity_project
unityVersion: 2022.3.50f1
testMode: playmode
customParameters: -nographics
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: PlayMode test results

- name: Backend logs on failure
if: failure()
run: docker compose logs
working-directory: _backend

- name: Tear down sdk_demo_backend
if: always()
run: docker compose down -v
working-directory: _backend
Loading