-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rgb/9126_popupSheetMenu
- Loading branch information
Showing
864 changed files
with
17,196 additions
and
4,294 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,45 @@ | ||
#!/bin/sh | ||
|
||
# Get the current branch | ||
get_current_branch() { | ||
current_branch=$(git symbolic-ref --short HEAD) | ||
echo "$current_branch" | ||
# get the URL of a remote | ||
get_remote_url() { | ||
remote_name=$1 | ||
git remote get-url "$remote_name" | ||
} | ||
|
||
# Save the current branch | ||
current_branch=$(get_current_branch) | ||
echo "Current branch: $current_branch" | ||
# remote name associated with the restricted URL | ||
find_remote_name_by_url() { | ||
restricted_url="https://github.com/mozilla-mobile/firefox-ios.git" | ||
for remote in $(git remote); do | ||
remote_url=$(get_remote_url "$remote") | ||
if [ "$remote_url" = "$restricted_url" ]; then | ||
echo "$remote" | ||
return | ||
fi | ||
done | ||
echo "" | ||
} | ||
|
||
# current tracked remote and branch for the current local branch | ||
upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u}) | ||
current_tracked_remote=$(echo "$upstream" | cut -d'/' -f1) | ||
current_tracked_branch=$(echo "$upstream" | cut -d'/' -f2) | ||
|
||
echo "Current tracked remote: $current_tracked_remote" | ||
echo "Current tracked branch: $current_tracked_branch" | ||
|
||
restricted_remote=$(find_remote_name_by_url) | ||
echo "Restricted remote: $restricted_remote" | ||
|
||
# Special Case: remote being pushed to from the first argument of the pre-push hook | ||
push_remote_my=$1 | ||
echo "Push remote: $restricted_remote" | ||
|
||
# Check if the current branch is the restricted branch 'main' | ||
if [ "$current_branch" = "main" ]; then | ||
echo "Direct pushes to the 'main' branch are not allowed." | ||
exit 1 | ||
if [ "$current_tracked_branch" = "main" ]; then | ||
# if the push remote is the restricted remote | ||
if [ "$push_remote_my" = "$restricted_remote" ]; then | ||
echo "Direct pushes to the 'main' branch on the specified remote are not allowed." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,8 @@ jobs: | |
-scheme ${{ env.xcodebuild_scheme }} \ | ||
-target ${{ env.xcodebuild_target }} \ | ||
-derivedDataPath ~/DerivedData \ | ||
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}' | ||
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}' \ | ||
COMPILER_INDEX_STORE_ENABLE=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO ARCHS="arm64" | ||
working-directory: ${{ env.browser }} | ||
- name: Compress Derived Data | ||
id: compress-dd | ||
|
@@ -61,7 +62,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
ios_simulator: ['iPhone 15 Plus'] | ||
ios_simulator: ['iPhone 15 Plus', 'iPad Pro 13-inch (M4)'] | ||
steps: | ||
- name: Check out source code | ||
uses: actions/[email protected] | ||
|
@@ -70,7 +71,7 @@ jobs: | |
run: | | ||
gem install xcpretty -v 0.3.0 | ||
pip install blockkit==1.9.1 | ||
npm install -g [email protected] | ||
npm install -g [email protected] | ||
- name: Setup Xcode | ||
id: xcode | ||
run: | | ||
|
@@ -99,7 +100,7 @@ jobs: | |
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan Smoketest1 \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest1 \ | ||
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest1.xml && exit ${PIPESTATUS[0]} | ||
| tee xcodebuild-smoketest1.log | xcpretty -r junit --output ./junit-smoketest1.xml && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Run Smoketest2 | ||
|
@@ -113,7 +114,7 @@ jobs: | |
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan Smoketest2 \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest2 \ | ||
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest2.xml && exit ${PIPESTATUS[0]} | ||
| tee xcodebuild-smoketest2.log | xcpretty -r junit --output ./junit-smoketest2.xml && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Run Smoketest3 | ||
|
@@ -127,7 +128,7 @@ jobs: | |
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan Smoketest3 \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest3 \ | ||
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest3.xml && exit ${PIPESTATUS[0]} | ||
| tee xcodebuild-smoketest3.log | xcpretty -r junit --output ./junit-smoketest3.xml && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Run Smoketest4 | ||
|
@@ -141,7 +142,7 @@ jobs: | |
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan Smoketest4 \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results-smoketest4 \ | ||
| tee xcodebuild.log | xcpretty -r junit --output ./junit-smoketest4.xml && exit ${PIPESTATUS[0]} | ||
| tee xcodebuild-smoketest4.log | xcpretty -r junit --output ./junit-smoketest4.xml && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Determine pass/fail status | ||
|
@@ -167,20 +168,21 @@ jobs: | |
python ../test-fixtures/ci/convert_junit_to_markdown.py --smoke --github --${{ env.browser }} ./combined.xml ./github.md | ||
cat github.md >> $GITHUB_STEP_SUMMARY | ||
python ../test-fixtures/ci/convert_junit_to_markdown.py --smoke --slack --${{ env.browser }} ./combined.xml ./slack.json | ||
mv ./combined.xml "junit-smoketests-${{ matrix.ios_simulator }}-`date +"%Y-%m-%d"`.xml" | ||
working-directory: ${{ env.browser }} | ||
- name: Upload junit files | ||
id: upload-junit | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-smoketests-${{ matrix.ios_simulator }}-junit-${{ github.run_number }} | ||
path: ${{ env.browser }}/junit-*.xml | ||
path: ${{ env.browser }}/junit-smoketests-*.xml | ||
retention-days: 90 | ||
- name: Upload log file | ||
id: upload-log | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-smoketests-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }} | ||
path: ${{ env.browser }}/xcodebuild.log | ||
path: ${{ env.browser }}/xcodebuild-smoketest*.log | ||
retention-days: 90 | ||
- name: Report to Slack | ||
id: slack | ||
|
@@ -203,81 +205,83 @@ jobs: | |
exit ${{ steps.passfail.outcome == 'success' && '0' || '1' }} | ||
run-fullfunctionaltests: | ||
name: Run full functional tests | ||
runs-on: macos-14 | ||
needs: compile | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ios_simulator: ['iPhone 15 Plus'] | ||
steps: | ||
- name: Check out source code | ||
uses: actions/[email protected] | ||
- name: Install packages | ||
id: packages | ||
run: | | ||
gem install xcpretty -v 0.3.0 | ||
pip install blockkit==1.9.1 | ||
- name: Get derived data | ||
id: download-derived-data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} | ||
- name: Decompress derived data | ||
id: decompress-dd | ||
run: | | ||
tar xzf derived-data.tar.gz -C / | ||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
xcodebuild \ | ||
test-without-building \ | ||
-scheme ${{ env.xcodebuild_scheme }} \ | ||
-target ${{ env.xcodebuild_target }} \ | ||
-derivedDataPath ~/DerivedData \ | ||
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan FullFunctionalTestPlan \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results \ | ||
| tee xcodebuild.log | xcpretty -r junit && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Print test report | ||
id: test-report | ||
run: | | ||
python ../test-fixtures/ci/convert_junit_to_markdown.py --github --${{ env.browser }} ./build/reports/junit.xml ./github.md | ||
cat github.md >> $GITHUB_STEP_SUMMARY | ||
python ../test-fixtures/ci/convert_junit_to_markdown.py --slack --${{ env.browser }} ./build/reports/junit.xml ./slack.json | ||
working-directory: ${{ env.browser }} | ||
- name: Upload junit files | ||
id: upload-junit | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-junit-${{ github.run_number }} | ||
path: ${{ env.browser }}/junit-*.xml | ||
retention-days: 90 | ||
- name: Upload log file | ||
id: upload-log | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }} | ||
path: ${{ env.browser }}/xcodebuild.log | ||
retention-days: 90 | ||
- name: Report to Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
payload-file-path: ${{ env.browser }}/slack.json | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
ios_simulator: ${{ matrix.ios_simulator }} | ||
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }} | ||
xcodebuild_test_plan: FullFunctionalTestPlan | ||
ref_name: ${{ github.ref_name }} | ||
repository: ${{ github.repository }} | ||
run_id: ${{ github.run_id }} | ||
server_url: ${{ github.server_url }} | ||
sha: ${{ github.sha }} | ||
- name: Return fail status if a test fails | ||
run: | | ||
exit ${{ steps.run-tests.outcome == 'success' && '0' || '1' }} | ||
name: Run full functional tests | ||
runs-on: macos-14 | ||
needs: compile | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ios_simulator: ['iPhone 15 Pro Max'] | ||
steps: | ||
- name: Check out source code | ||
uses: actions/[email protected] | ||
- name: Install packages | ||
id: packages | ||
run: | | ||
gem install xcpretty -v 0.3.0 | ||
pip install blockkit==1.9.1 | ||
- name: Get derived data | ||
id: download-derived-data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} | ||
- name: Decompress derived data | ||
id: decompress-dd | ||
run: | | ||
tar xzf derived-data.tar.gz -C / | ||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
xcrun simctl boot '${{ matrix.ios_simulator }}' | ||
xcodebuild \ | ||
test-without-building \ | ||
-scheme ${{ env.xcodebuild_scheme }} \ | ||
-target ${{ env.xcodebuild_target }} \ | ||
-derivedDataPath ~/DerivedData \ | ||
-destination 'platform=iOS Simulator,name=${{ matrix.ios_simulator }},OS=${{ env.ios_version }}' \ | ||
-testPlan FullFunctionalTestPlan \ | ||
-resultBundlePath ${{ env.test_results_directory }}/results \ | ||
| tee xcodebuild.log | xcpretty -r junit && exit ${PIPESTATUS[0]} | ||
working-directory: ${{ env.browser }} | ||
continue-on-error: true | ||
- name: Print test report | ||
id: test-report | ||
run: | | ||
python ../test-fixtures/ci/convert_junit_to_markdown.py --github --${{ env.browser }} ./build/reports/junit.xml ./github.md | ||
cat github.md >> $GITHUB_STEP_SUMMARY | ||
python ../test-fixtures/ci/convert_junit_to_markdown.py --slack --${{ env.browser }} ./build/reports/junit.xml ./slack.json | ||
mv ./build/reports/junit.xml "junit-fullfunctional-${{ matrix.ios_simulator }}-`date +"%Y-%m-%d"`.xml" | ||
working-directory: ${{ env.browser }} | ||
- name: Upload junit files | ||
id: upload-junit | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-junit-${{ github.run_number }} | ||
path: ${{ env.browser }}/junit-*.xml | ||
retention-days: 90 | ||
- name: Upload log file | ||
id: upload-log | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-fullfunctional-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }} | ||
path: ${{ env.browser }}/xcodebuild.log | ||
retention-days: 90 | ||
- name: Report to Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
payload-file-path: ${{ env.browser }}/slack.json | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
ios_simulator: ${{ matrix.ios_simulator }} | ||
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }} | ||
xcodebuild_test_plan: FullFunctionalTestPlan | ||
ref_name: ${{ github.ref_name }} | ||
repository: ${{ github.repository }} | ||
run_id: ${{ github.run_id }} | ||
server_url: ${{ github.server_url }} | ||
sha: ${{ github.sha }} | ||
- name: Return fail status if a test fails | ||
run: | | ||
exit ${{ steps.run-tests.outcome == 'success' && '0' || '1' }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,8 @@ jobs: | |
-scheme ${{ env.xcodebuild_scheme }} \ | ||
-target ${{ env.xcodebuild_target }} \ | ||
-derivedDataPath ~/DerivedData \ | ||
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}' | ||
-destination 'platform=iOS Simulator,name=${{ env.ios_simulator_default }},OS=${{ env.ios_version }}' \ | ||
COMPILER_INDEX_STORE_ENABLE=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO ARCH="arm64" | ||
working-directory: ${{ env.browser }} | ||
- name: Save Derived Data | ||
id: upload-derived-data | ||
|
@@ -108,6 +109,13 @@ jobs: | |
name: ${{ env.browser }}-${{ matrix.xcodebuild_test_plan }}-${{ matrix.ios_simulator }}-xcodebuildlog-${{ github.run_number }} | ||
path: ${{ env.browser }}/xcodebuild.log | ||
retention-days: 90 | ||
- name: Upload junit files | ||
id: upload-junit | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.browser }}-${{ matrix.xcodebuild_test_plan }}-${{ matrix.ios_simulator }}-junit-${{ github.run_number }} | ||
path: ${{ env.browser }}/build/reports/junit.xml | ||
retention-days: 90 | ||
- name: Report to Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
|
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
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
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
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
Oops, something went wrong.