Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test setup env gha #1210

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
121 changes: 37 additions & 84 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,20 +279,13 @@ jobs:
with:
ref: ${{needs.check_and_prepare.outputs.github_ref}}
submodules: true
- name: Setup python
uses: actions/setup-python@v4
- name: Setup Env
uses: ./gha/setup_env
with:
python-version: ${{ env.pythonVersion }}
- name: Install Desktop SDK & integration tests prerequisites
uses: nick-invision/retry@v2
with:
shell: bash
timeout_minutes: 15
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p Desktop -a '${{ matrix.arch }}' -s '${{ matrix.ssl_variant }}'
- name: Add msbuild to PATH (Windows)
if: startsWith(matrix.os, 'windows')
uses: microsoft/[email protected]
os: ${{ matrix.os }}
platform: 'Desktop'
arch: ${{ matrix.arch }}
ssl_variant: ${{ matrix.ssl_variant }}
- name: Cache vcpkg C++ dependencies
id: cache_vcpkg
uses: actions/cache@v3
Expand Down Expand Up @@ -409,26 +402,17 @@ jobs:
with:
ref: ${{needs.check_and_prepare.outputs.github_ref}}
submodules: true
- name: Add msbuild to PATH (Windows)
if: startsWith(matrix.os, 'windows')
uses: microsoft/[email protected]
- name: Setup Env
uses: ./gha/setup_env
with:
os: ${{ matrix.os }}
platform: 'Android'
- name: Cache NDK
id: cache_ndk
uses: actions/cache@v3
with:
path: /tmp/android-ndk-r21e
key: android-ndk-${{ matrix.os }}-r21e
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Install Android SDK & integration tests prerequisites
uses: nick-invision/retry@v2
with:
shell: bash
timeout_minutes: 10
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p Android
- name: Fetch prebuilt packaged SDK from previous run
uses: dawidd6/action-download-artifact@v2
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
Expand Down Expand Up @@ -517,16 +501,10 @@ jobs:
with:
ref: ${{needs.check_and_prepare.outputs.github_ref}}
submodules: true
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Install iOS SDK & integration tests prerequisites
uses: nick-invision/retry@v2
- name: Setup Env
uses: ./gha/setup_env
with:
timeout_minutes: 3
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p iOS
platform: 'iOS'
- name: Fetch prebuilt packaged SDK from previous run
uses: dawidd6/action-download-artifact@v2
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
Expand Down Expand Up @@ -616,16 +594,10 @@ jobs:
with:
ref: ${{needs.check_and_prepare.outputs.github_ref}}
submodules: true
- name: Setup python
uses: actions/setup-python@v4
- name: Setup Env
uses: ./gha/setup_env
with:
python-version: ${{ env.pythonVersion }}
- name: Install tvOS SDK & integration tests prerequisites
uses: nick-invision/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p tvOS
platform: 'tvOS'
- name: Fetch prebuilt packaged SDK from previous run
uses: dawidd6/action-download-artifact@v2
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
Expand Down Expand Up @@ -744,17 +716,14 @@ jobs:
with:
path: testapps/testapps-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}
name: testapps-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Install prerequisites for testing
uses: nick-invision/retry@v2
with:
shell: bash
timeout_minutes: 15
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p Desktop -t true -a '${{ matrix.arch }}' -s '${{ matrix.ssl_variant }}'
- name: Setup Env
uses: ./gha/setup_env
with:
os: ${{ matrix.os }}
platform: 'Desktop'
arch: ${{ matrix.arch }}
ssl_variant: ${{ matrix.ssl_variant }}
test: 'true'
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -998,17 +967,11 @@ jobs:
with:
path: testapps/testapps-android-${{ matrix.build_os }}
name: testapps-android-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v4
- name: Setup Env
uses: ./gha/setup_env
with:
python-version: ${{ env.pythonVersion }}
- name: Install prerequisites for testing
uses: nick-invision/retry@v2
with:
shell: bash
timeout_minutes: 5
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p Android -t true
platform: 'Android'
test: 'true'
- name: Get Device Info
id: device-info
run: |
Expand Down Expand Up @@ -1126,16 +1089,11 @@ jobs:
with:
path: testapps/testapps-ios-${{ matrix.build_os }}
name: testapps-ios-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Install prerequisites for testing
uses: nick-invision/retry@v2
- name: Setup Env
uses: ./gha/setup_env
with:
timeout_minutes: 3
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p iOS -t true
platform: 'iOS'
test: 'true'
- name: Device Info
id: device-info
run: |
Expand Down Expand Up @@ -1254,16 +1212,11 @@ jobs:
with:
path: testapps/testapps-tvos-${{ matrix.build_os }}
name: testapps-tvos-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v4
- name: Setup Env
uses: ./gha/setup_env
with:
python-version: ${{ env.pythonVersion }}
- name: Install prerequisites for testing
uses: nick-invision/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p tvOS -t true
platform: 'tvOS'
test: 'true'
- name: Setup java for Firestore emulator
uses: actions/setup-java@v3
with:
Expand Down
44 changes: 44 additions & 0 deletions gha/setup_env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Unity Setup'
inputs:
os:
required: false
platform:
required: true
arch:
required: false
ssl_variant:
required: false
test:
required: false

runs:
using: 'composite'
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.pythonVersion }}
- name: Add msbuild to PATH (Windows)
if: startsWith(inputs.os, 'windows')
uses: microsoft/[email protected]
- name: Install Desktop SDK & integration tests prerequisites
uses: nick-invision/retry@v2
with:
shell: bash
timeout_minutes: 15
max_attempts: 3
command: scripts/gha/install_test_workflow_prereqs.sh -p ${{ inputs.platform }} -a '${{ inputs.arch }}' -s '${{ inputs.ssl_variant }}' -t '${{ inputs.test }}'