Skip to content

Commit

Permalink
Merge branch 'main' into rgb/9126_popupSheetMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
adudenamedruby committed Aug 27, 2024
2 parents c51b2d4 + a20fc22 commit 4197c67
Show file tree
Hide file tree
Showing 864 changed files with 17,196 additions and 4,294 deletions.
48 changes: 37 additions & 11 deletions .githooks/pre-push
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
178 changes: 91 additions & 87 deletions .github/workflows/firefox-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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' }}
10 changes: 9 additions & 1 deletion .github/workflows/focus-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ only_rules: # Only enforce these rules, ignore all others
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition
- accessibility_label_for_image
- accessibility_trait_for_button

# These rules were originally opted into. Disabling for now to get
# Swiftlint up and running.
Expand Down
2 changes: 1 addition & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ tasks:
$if: >
tasks_for in ["action", "cron"]
|| (isPullRequest && pullRequestAction in ["opened", "reopened", "synchronize"])
|| (tasks_for == "github-push" && (short_head_branch == "main" || short_head_branch[:8] == "releases"))
|| (tasks_for == "github-push" && short_head_branch == "main")
|| (tasks_for == "github-release" && releaseAction == "published")
then:
taskId:
Expand Down
4 changes: 2 additions & 2 deletions BrowserKit/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa.git",
"state" : {
"revision" : "38f4f70d07117b9f958a76b1bff278c2f29ffe0e",
"version" : "8.21.0"
"revision" : "d2ced2d961b34573ebd2ea0567a2f1408e90f0ae",
"version" : "8.34.0"
}
},
{
Expand Down
12 changes: 11 additions & 1 deletion BrowserKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ let package = Package(
.library(
name: "ToolbarKit",
targets: ["ToolbarKit"]),
.library(
name: "MenuKit",
targets: ["MenuKit"]),
.library(
name: "ContentBlockingGenerator",
targets: ["ContentBlockingGenerator"]),
Expand All @@ -52,7 +55,7 @@ let package = Package(
exact: "2.0.0"),
.package(
url: "https://github.com/getsentry/sentry-cocoa.git",
exact: "8.21.0"),
exact: "8.34.0"),
.package(url: "https://github.com/nbhasin2/GCDWebServer.git",
branch: "master")
],
Expand Down Expand Up @@ -109,6 +112,13 @@ let package = Package(
.testTarget(
name: "ToolbarKitTests",
dependencies: ["ToolbarKit"]),
.target(
name: "MenuKit",
dependencies: ["Common"],
swiftSettings: [.unsafeFlags(["-enable-testing"])]),
.testTarget(
name: "MenuKitTests",
dependencies: ["MenuKit"]),
.target(
name: "ContentBlockingGenerator",
swiftSettings: [.unsafeFlags(["-enable-testing"])]),
Expand Down
Loading

0 comments on commit 4197c67

Please sign in to comment.