🔄🎮ci-gamium #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🔄🎮ci-gamium | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: 'Gamium revision (tag, branch, commit)' | |
default: 'main' | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
max-parallel: 10 | |
fail-fast: false | |
matrix: | |
project: [DoguRpgSample, DragonCrashers, DypThePenguin, UnityUISamples, InputSystemWarriors, HardTestsProject] | |
platform: [windows, android, ios] | |
include: | |
- platform: windows | |
runner_os: Windows | |
unity_buildtarget: standalonewindows64 | |
build_ext: .exe | |
do_test: true | |
- platform: android | |
runner_os: Windows | |
unity_buildtarget: android | |
build_ext: .apk | |
do_test: false | |
- platform: ios | |
runner_os: macOS | |
unity_buildtarget: ios | |
build_ext: .ipa | |
do_test: false | |
runs-on: [self-hosted, '${{ matrix.runner_os }}'] | |
steps: | |
- name: Output Inputs | |
run: echo "${{ toJSON(github.event.inputs) }}" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
clean: false | |
- name: Clone gamium-unity-samples | |
uses: actions/checkout@v3 | |
with: | |
repository: dogu-team/gamium-unity-samples | |
token: ${{ secrets.DOGU_GITHUB_TOKEN }} | |
clean: false | |
path: gamium-unity-samples | |
- name: Run newbie | |
run: | | |
yarn run newbie | |
- name: Build | |
run: | | |
yarn build | |
- name: Build ${{ matrix.project }} ${{ matrix.unity_buildtarget }} | |
run: | | |
yarn && yarn run build:unity:sample | |
env: | |
DOGU_GAMIUM_ENGINE_UNITY_SAMPLES_PATH: '${{ github.workspace }}/gamium-unity-samples' | |
DOGU_GAMIUM_ENGINE_UNITY_SAMPLE_NAME: ${{ matrix.project }} | |
DOGU_GAMIUM_ENGINE_VERSION: ${{ github.event.inputs.version == '' && github.head_ref || github.event.inputs.version }} | |
DOGU_UNITY_BUILD_TARGET: ${{ matrix.unity_buildtarget }} | |
DOGU_GITHUB_TOKEN: ${{ secrets.DOGU_GITHUB_TOKEN }} | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
working-directory: ./gamium-unity-samples/scripts/build-script | |
- name: Build | |
id: project-lower | |
uses: ASzc/change-string-case-action@v5 | |
with: | |
string: ${{ matrix.project }} | |
- name: Run ${{ matrix.project }} typescript | |
if: ${{ matrix.do_test }} | |
run: | | |
yarn && ${{ github.workspace }}/gamium-unity-samples/${{ matrix.project }}/build/${{ matrix.unity_buildtarget }}/${{ steps.project-lower.outputs.lowercase }}${{ matrix.build_ext }} && yarn run:${{ matrix.project }} | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
working-directory: ./gamium-unity-samples/client/typescript | |
- name: Prepare python | |
if: ${{ matrix.do_test }} | |
run: | | |
pip3 install -r requirements.txt | |
working-directory: ./gamium-unity-samples/client/python | |
continue-on-error: true | |
- name: Run ${{ matrix.project }} python | |
if: ${{ matrix.do_test }} | |
run: | | |
${{ github.workspace }}/gamium-unity-samples/${{ matrix.project }}/build/${{ matrix.unity_buildtarget }}/${{ steps.project-lower.outputs.lowercase }}${{ matrix.build_ext }} && python ${{ steps.project-lower.outputs.lowercase }}-test.py | |
working-directory: ./gamium-unity-samples/client/python | |
send-slack: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: ${{ always() }} | |
steps: | |
- name: Send Slack | |
uses: dogu-team/[email protected] | |
with: | |
template: 'CI' | |
slack-channel-id: 'C03PL9TC44Q' | |
result-status: ${{ needs.build.result }} | |
ignore-notify: ${{ needs.build.result == 'success' }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |