Skip to content

Merge branch 'development' into 1377-remove-input-visualizer #1720

Merge branch 'development' into 1377-remove-input-visualizer

Merge branch 'development' into 1377-remove-input-visualizer #1720

Workflow file for this run

name: Push
on: [push, workflow_dispatch]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
java: ${{ steps.filter.outputs.java }}
python: ${{ steps.filter.outputs.python }}
csharp: ${{ steps.filter.outputs.csharp }}
editor: ${{ steps.filter.outputs.editor }}
docs: ${{ steps.filter.outputs.docs }}
scenes: ${{steps.filter.outputs.scenes}}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
java:
- 'Bindings~/java/**'
python:
- 'Bindings~/python/**'
csharp:
- '**.cs'
editor:
- '**.cs'
docs:
- 'Docs/**'
scenes:
- 'Assets/AltTester/Examples/Scenes/**'
build-docs:
runs-on: ubuntu-latest
needs: paths-filter
if: needs.paths-filter.outputs.docs == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r "Docs/requirements.txt"
- name: Build docs
run: |
cd Docs
make versionedhtml
- uses: actions/upload-artifact@v3
with:
name: DocumentationHTML
path: Docs/build/
build-macOS:
runs-on: [self-hosted, macOS]
needs: paths-filter
if: needs.paths-filter.outputs.csharp == 'true' || needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true' || needs.paths-filter.outputs.java == 'true'
steps:
- uses: actions/checkout@v3
- name: Build SampleGame
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
$UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath $CI_PROJECT_DIR -executeMethod AltTesterTools.BuildAltTester.MacBuildFromCommandLine -logFile buildMac.log -quit
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: BuildMacArtifact
path: |
sampleGame.app
**/*.log
build-android:
runs-on: [self-hosted, macOS]
needs: paths-filter
if: needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true'
steps:
- uses: actions/checkout@v3
- name: Build SampleGame apk
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
$UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath $CI_PROJECT_DIR -executeMethod AltTesterTools.BuildAltTester.AndroidBuildFromCommandLine -logFile buildAndroid.log -quit
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: BuildAndroidArtifact
path: |
sampleGame.apk
**/*.log
test-CSharp-Editor:
runs-on: [self-hosted, macOS]
needs: build-macOS
if: needs.paths-filter.outputs.csharp == 'true' || needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true' || needs.paths-filter.outputs.java == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BuildMacArtifact
- run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
chmod -R 755 sampleGame.app
open sampleGame.app
- run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
$UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath $CI_PROJECT_DIR -executeMethod AltTester.AltTesterUnitySDK.Editor.AltTestRunner.RunTestFromCommandLine -testsAssembly Assembly-CSharp-Editor -logFile - -quit
#TODO add back -reportPath $CI_PROJECT_DIR/reportTest.xml for removing because it's giving me unauthorized error
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: TestCSharpArtifact
path: |
**/*.log
**/*.log
reportTest.xml
test-DotNet:
runs-on: [self-hosted, macOS]
needs: build-macOS
if: needs.paths-filter.outputs.csharp == 'true' || needs.paths-filter.outputs.scenes == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BuildMacArtifact
- name: Setup .NET Core SDK
uses: actions/[email protected]
- run: |
export ALTSERVER_PORT=13005
echo $ALTSERVER_PORT
export ALTSERVER_HOST="192.168.11.35"
chmod -R 755 sampleGame.app
open sampleGame.app
dotnet test Bindings~/dotnet/AltDriver.Tests/AltDriver.Tests.csproj --logger:"console;verbosity=detailed"
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: TestCSharpArtifact
path: "**/*.log"
test-Python:
runs-on: [self-hosted, macOS]
needs: build-macOS
if: needs.paths-filter.outputs.python == 'true' || needs.paths-filter.outputs.scenes == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BuildMacArtifact
- name: Open application
run: |
export RUN_ANDROID_IN_BROWSERSTACK="false"
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
chmod -R 755 sampleGame.app
open sampleGame.app
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip uninstall AltTester-Driver
pip install -r "Bindings~/python/requirements.txt"
pip install -r "Bindings~/python/requirements-dev.txt"
pip install -e "Bindings~/python" --root "Bindings~/python"
- name: Lint with flake8
run: |
flake8 Bindings~/python/ --config Bindings~/python/.flake8
- name: Run unit tests
run: |
pytest Bindings~/python/tests/unit
- name: Run integration tests
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
pytest Bindings~/python/tests/integration
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: TestPythonArtifact
path: "**/*.log"
test-Java:
runs-on: [self-hosted, macOS]
needs: build-macOS
if: needs.paths-filter.outputs.java == 'true' || needs.paths-filter.outputs.scenes == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BuildMacArtifact
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 11
- name: Set up Maven # setup-java does't install maven on self-hosted driver
uses: stCarolas/[email protected]
- run: |
export ALTSERVER_PORT=13005
echo $ALTSERVER_PORT
export ALTSERVER_HOST="192.168.11.35"
chmod -R 755 sampleGame.app
open sampleGame.app
cd "Bindings~/java"
mvn -Dtest=com.alttester.Tests* test
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: TestJavaArtifact
path: "**/*.log"
copyright:
runs-on: [self-hosted, macOS]
steps:
- run: |
pwsh copyright.ps1
test-Python-Android-Browserstack:
runs-on: [self-hosted, macOS]
needs: build-android
if: needs.paths-filter.outputs.python == 'true' || needs.paths-filter.outputs.scenes == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BuildAndroidArtifact
- name: Copy application to Python test folder
run: |
cp sampleGame.apk Bindings~/python
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip uninstall AltTester-Driver
pip install -r "Bindings~/python/requirements.txt"
pip install -r "Bindings~/python/requirements-dev.txt"
pip install -e "Bindings~/python" --root "Bindings~/python"
- name: Run integration tests
run: |
export RUN_ANDROID_IN_BROWSERSTACK="true"
export BROWSERSTACK_USERNAME=${{ secrets.BROWSERSTACK_USERNAME }}
export BROWSERSTACK_KEY=${{ secrets.BROWSERSTACK_KEY }}
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
pytest -s Bindings~/python/tests/integration
- uses: actions/upload-artifact@v3
if: always() # run this step even if one of the previous step failed
with:
name: TestPythonAndroidInBrowserstackArtifact
path: "**/*.log"
- name: Unset Browserstack Flag
if: always()
run: |
export RUN_ANDROID_IN_BROWSERSTACK="false"
deploy-dev-docs:
runs-on: ubuntu-latest
needs: build-docs
if: github.ref == 'refs/heads/development'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: DocumentationHTML
path: DocumentationHTML/
- name: Replace URL
uses: jacobtomlinson/gha-find-replace@v3
with:
find: ${{ secrets.LIVE_URL_ALTTESTER }}
replace: ${{ secrets.DEV_URL_ALTTESTER }}
regex: true
- name: Update AltTester Desktop link for latest version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: ${{ secrets.DEV_URL_ALTTESTER }}/docs/desktop/.*?/
replace: ${{ secrets.DEV_URL_ALTTESTER }}/docs/desktop/latest/
include: "DocumentationHTML/latest/**"
- name: Upload documentation
uses: garygrossgarten/github-action-scp@release
with:
local: DocumentationHTML
remote: ${{ secrets.DOCUMENTATION_PATH }}
host: ${{ secrets.HOST_IP_ALTTESTER }}
port: ${{ secrets.PORT_DEV_ALTTESTER }}
username: ${{ secrets.USERNAME_ALTTESTER }}
password: ${{ secrets.PASSWORD_ALTTESTER }}
rmRemote: true
deploy-docs:
runs-on: ubuntu-latest
needs: build-docs
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: DocumentationHTML
path: DocumentationHTML/
- name: Update AltTester Desktop link for latest version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: ${{ secrets.LIVE_URL_ALTTESTER }}/docs/desktop/.*?/
replace: ${{ secrets.LIVE_URL_ALTTESTER }}/docs/desktop/latest/
include: "DocumentationHTML/latest/**"
- name: Upload documentation
uses: garygrossgarten/github-action-scp@release
with:
local: DocumentationHTML
remote: ${{ secrets.DOCUMENTATION_PATH }}
host: ${{ secrets.HOST_IP_ALTTESTER }}
port: ${{ secrets.PORT_LIVE_ALTTESTER }}
username: ${{ secrets.USERNAME_ALTTESTER }}
password: ${{ secrets.PASSWORD_ALTTESTER }}
rmRemote: true