Skip to content

Use build OS variables instead of hard coded build OS names #922

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

Merged
merged 20 commits into from
May 5, 2022
Merged
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
82 changes: 44 additions & 38 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,14 @@ jobs:
fi

build_ios:
name: build-ios-macos-latest
name: build-ios-${{ matrix.os }}
needs: [check_and_prepare]
runs-on: macos-12
runs-on: ${{ matrix.os }}
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'iOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
strategy:
fail-fast: false
matrix:
os: [macos-12]
steps:
- name: setup Xcode version (macos)
if: runner.os == 'macOS'
Expand Down Expand Up @@ -599,30 +601,30 @@ jobs:
--t ${{ needs.check_and_prepare.outputs.apis }} \
--output_directory "${{ github.workspace }}" \
--ios_sdk ${{ needs.check_and_prepare.outputs.mobile_test_on }} \
--artifact_name "ios-macos-12" \
--artifact_name "ios-${{ matrix.os }}" \
--noadd_timestamp \
--short_output_paths \
${additional_flags[*]}
- name: Prepare results summary artifact
if: ${{ !cancelled() }}
shell: bash
run: |
if [ ! -f build-results-ios-macos-12.log.json ]; then
echo "__SUMMARY_MISSING__" > build-results-ios-macos-12.log.json
if [ ! -f build-results-ios-${{ matrix.os }}.log.json ]; then
echo "__SUMMARY_MISSING__" > build-results-ios-${{ matrix.os }}.log.json
fi
- name: Upload iOS integration tests artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: testapps-ios-macos-12
path: testapps-ios-macos-12
name: testapps-ios-${{ matrix.os }}
path: testapps-ios-${{ matrix.os }}
retention-days: ${{ env.artifactRetentionDays }}
- name: Upload iOS build results artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: log-artifact
path: build-results-ios-macos-12*
path: build-results-ios-${{ matrix.os }}*
retention-days: ${{ env.artifactRetentionDays }}
- name: Download log artifacts
if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
Expand All @@ -643,18 +645,20 @@ jobs:
if: ${{ !cancelled() }}
shell: bash
run: |
cat build-results-ios-macos-12.log
cat build-results-ios-${{ matrix.os }}.log
if [[ "${{ job.status }}" != "success" ]]; then
exit 1
fi

build_tvos:
name: build-tvos-macos-latest
name: build-tvos-${{ matrix.os }}
needs: [check_and_prepare]
runs-on: macos-12
runs-on: ${{ matrix.os }}
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'tvOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
strategy:
fail-fast: false
matrix:
os: [macos-12]
steps:
- name: setup Xcode version (macos)
if: runner.os == 'macOS'
Expand Down Expand Up @@ -715,30 +719,30 @@ jobs:
python scripts/gha/build_testapps.py --p tvOS \
--t ${{ needs.check_and_prepare.outputs.apis }} \
--output_directory "${{ github.workspace }}" \
--artifact_name "tvos-macos-12" \
--artifact_name "tvos-${{ matrix.os }}" \
--noadd_timestamp \
--short_output_paths \
${additional_flags[*]}
- name: Prepare results summary artifact
if: ${{ !cancelled() }}
shell: bash
run: |
if [ ! -f build-results-tvos-macos-12.log.json ]; then
echo "__SUMMARY_MISSING__" > build-results-tvos-macos-12.log.json
if [ ! -f build-results-tvos-${{ matrix.os }}.log.json ]; then
echo "__SUMMARY_MISSING__" > build-results-tvos-${{ matrix.os }}.log.json
fi
- name: Upload tvOS integration tests artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: testapps-tvos-macos-12
path: testapps-tvos-macos-12
name: testapps-tvos-${{ matrix.os }}
path: testapps-tvos-${{ matrix.os }}
retention-days: ${{ env.artifactRetentionDays }}
- name: Upload tvOS build results artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: log-artifact
path: build-results-tvos-macos-12*
path: build-results-tvos-${{ matrix.os }}*
retention-days: ${{ env.artifactRetentionDays }}
- name: Download log artifacts
if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
Expand All @@ -759,7 +763,7 @@ jobs:
if: ${{ !cancelled() }}
shell: bash
run: |
cat build-results-tvos-macos-12.log
cat build-results-tvos-${{ matrix.os }}.log
if [[ "${{ job.status }}" != "success" ]]; then
exit 1
fi
Expand All @@ -784,7 +788,7 @@ jobs:
- name: Download Desktop integration tests artifact
uses: actions/download-artifact@v3
with:
path: testapps
path: testapps/testapps-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}
name: testapps-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}
- name: Setup python
uses: actions/setup-python@v2
Expand All @@ -805,7 +809,7 @@ jobs:
shell: bash
command: |
pip install -r scripts/gha/requirements.txt
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact "testapps/testapps-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}"
- name: Run Desktop integration tests
env:
USE_FIRESTORE_EMULATOR: true
Expand Down Expand Up @@ -875,7 +879,7 @@ jobs:
- name: Download Android integration tests artifact
uses: actions/download-artifact@v3
with:
path: testapps
path: testapps/testapps-android-${{ matrix.build_os }}
name: testapps-android-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v2
Expand Down Expand Up @@ -961,14 +965,15 @@ jobs:
fi

test_ios:
name: test-ios-macos-latest-${{ matrix.ios_device }}
name: test-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}
needs: [check_and_prepare, build_ios]
runs-on: macos-12
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'iOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
strategy:
fail-fast: false
matrix:
ios_device: ${{ fromJson(needs.check_and_prepare.outputs.ios_device) }}
build_os: [macos-12]
steps:
- name: setup Xcode version (macos)
if: runner.os == 'macOS'
Expand All @@ -979,8 +984,8 @@ jobs:
- name: Download iOS integration tests artifact
uses: actions/download-artifact@v3
with:
path: testapps
name: testapps-ios-macos-12
path: testapps/testapps-ios-${{ matrix.build_os }}
name: testapps-ios-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -1009,7 +1014,7 @@ jobs:
run: |
python scripts/gha/test_simulator.py --testapp_dir testapps \
--ios_device "${{ matrix.ios_device }}" \
--logfile_name "ios-macos-12-${{ matrix.ios_device }}" \
--logfile_name "ios-${{ matrix.build_os }}-${{ matrix.ios_device }}" \
--ci
- name: Install Cloud SDK
if: steps.get-device-type.outputs.device_type == 'real'
Expand All @@ -1022,23 +1027,23 @@ jobs:
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
python scripts/gha/test_lab.py --testapp_dir testapps \
--ios_device "${{ matrix.ios_device }}" \
--logfile_name "ios-macos-12-${{ matrix.ios_device }}" \
--logfile_name "ios-${{ matrix.build_os }}-${{ matrix.ios_device }}" \
--code_platform cpp \
--key_file scripts/gha-encrypted/gcs_key_file.json
- name: Prepare results summary artifact
if: ${{ !cancelled() }}
shell: bash
run: |
# If testapps do not exist, then it's a build error not test error.
if [ -d "testapps/testapps-ios-macos-12" && ! -f "testapps/test-results-ios-macos-12-${{ matrix.ios_device }}.log.json" ]; then
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-ios-macos-12-${{ matrix.ios_device }}.log.json"
if [ -d "testapps/testapps-ios-${{ matrix.build_os }}" && ! -f "testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}.log.json" ]; then
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}.log.json"
fi
- name: Upload iOS test results artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: log-artifact
path: testapps/test-results-ios-macos-12-${{ matrix.ios_device }}*
path: testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}*
retention-days: ${{ env.artifactRetentionDays }}
- name: Download log artifacts
if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
Expand All @@ -1059,20 +1064,21 @@ jobs:
if: ${{ !cancelled() }}
shell: bash
run: |
cat "testapps/test-results-ios-macos-12-${{ matrix.ios_device }}.log"
cat "testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}.log"
if [[ "${{ job.status }}" != "success" ]]; then
exit 1
fi

test_tvos:
name: test-tvos-macos-latest-${{ matrix.tvos_device }}
name: test-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}
needs: [check_and_prepare, build_tvos]
runs-on: macos-12
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'tvOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
strategy:
fail-fast: false
matrix:
tvos_device: ${{ fromJson(needs.check_and_prepare.outputs.tvos_device) }}
build_os: [macos-12]
steps:
- name: setup Xcode version (macos)
if: runner.os == 'macOS'
Expand All @@ -1083,8 +1089,8 @@ jobs:
- name: Download tvOS integration tests artifact
uses: actions/download-artifact@v3
with:
path: testapps
name: testapps-tvos-macos-12
path: testapps/testapps-tvos-${{ matrix.build_os }}
name: testapps-tvos-${{ matrix.build_os }}
- name: Setup python
uses: actions/setup-python@v2
with:
Expand All @@ -1105,22 +1111,22 @@ jobs:
run: |
python scripts/gha/test_simulator.py --testapp_dir testapps \
--tvos_device "${{ matrix.tvos_device }}" \
--logfile_name "tvos-macos-12-${{ matrix.tvos_device }}" \
--logfile_name "tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}" \
--ci
- name: Prepare results summary artifact
if: ${{ !cancelled() }}
shell: bash
run: |
# If testapps do not exist, then it's a build error not test error.
if [ -d "testapps/testapps-tvos-macos-12" && ! -f "testapps/test-results-tvos-macos-12-${{ matrix.tvos_device }}.log.json" ]; then
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-tvos-macos-12-${{ matrix.tvos_device }}.log.json"
if [ -d "testapps/testapps-tvos-${{ matrix.build_os }}" && ! -f "testapps/test-results-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}.log.json" ]; then
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}.log.json"
fi
- name: Upload tvOS test results artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: log-artifact
path: testapps/test-results-tvos-macos-12-${{ matrix.tvos_device }}*
path: testapps/test-results-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}*
retention-days: ${{ env.artifactRetentionDays }}
- name: Download log artifacts
if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
Expand All @@ -1141,7 +1147,7 @@ jobs:
if: ${{ !cancelled() }}
shell: bash
run: |
cat "testapps/test-results-tvos-macos-12-${{ matrix.tvos_device }}.log"
cat "testapps/test-results-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}.log"
if [[ "${{ job.status }}" != "success" ]]; then
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/gha/print_matrix_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"ios_latest": {"type": "real", "model":"iphone11pro", "version":"14.7"},
"simulator_min": {"type": "virtual", "name":"iPhone 6", "version":"12.4"},
"simulator_target": {"type": "virtual", "name":"iPhone 8", "version":"14.5"},
"simulator_latest": {"type": "virtual", "name":"iPhone 11", "version":"15.4"},
"simulator_latest": {"type": "virtual", "name":"iPhone 11", "version":"15.2"},
"tvos_simulator": {"type": "virtual", "name":"Apple TV", "version":"14.3"},
}

Expand Down