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

Run sync tests in matrix #2263

Merged
merged 17 commits into from
Dec 18, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ jobs:
echo "dsyms_path=${{ github.workspace }}/${{ env.dsyms_filename }}" >> $GITHUB_ENV

- name: Upload IPA artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.ipa_filename }}
path: ${{ env.ipa_path }}

- name: Upload dSYMs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.dsyms_filename }}
path: ${{ env.dsyms_path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
echo "build_version=${build_version}" >> $GITHUB_ENV

- name: Upload dSYMs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: DuckDuckGo-Alpha-dSYM-${{ env.app_version }}
path: ${{ env.dsyms_path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
--data ' { "data": { "name": "GH Workflow Failure - End to end tests", "workspace": "${{ vars.GH_ASANA_WORKSPACE_ID }}", "projects": [ "${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}" } }'

- name: Upload logs when workflow failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml

- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml

- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Upload dSYMs artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: DuckDuckGo-${{ steps.destination.outputs.destination }}-dSYM-${{ env.app_version }}
path: ${{ env.dsyms_path }}
Expand Down
95 changes: 55 additions & 40 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
- cron: '0 5 * * *' # run at 5 AM UTC

jobs:
sync-end-to-end-tests:
name: Sync End to end Tests
build-for-sync-end-to-end-tests:
name: Build for Sync End To End Tests
runs-on: macos-13
timeout-minutes: 30

steps:
- name: Check out the code
Expand Down Expand Up @@ -43,62 +44,76 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath "DerivedData" \
| tee xcodebuild.log

- name: Store Binary
uses: actions/upload-artifact@v4
with:
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Upload logs when workflow failed
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7

sync-end-to-end-tests:
name: Sync End To End Tests
needs: build-for-sync-end-to-end-tests
runs-on: macos-13
timeout-minutes: 30
strategy:
ayoy marked this conversation as resolved.
Show resolved Hide resolved
matrix:
os-version: [15, 16, 17]
#max-parallel: 1 # Uncomment this line to run tests sequentially.
fail-fast: false

steps:
- name: Check out the code
uses: actions/checkout@v3 # Don't need submodules here as this is only for the tests folder

- name: Create test account for Sync and return the recovery code
uses: duckduckgo/sync_crypto/action@main
id: sync-recovery-code
with:
debug: true

- name: Sync e2e tests - iOS 15
uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
workspace: .maestro
include-tags: sync
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}

- name: Sync e2e tests - iOS 16
uses: mobile-dev-inc/[email protected]
- name: Retrieve Binary
uses: actions/download-artifact@v4
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
ios-version: 16
workspace: .maestro
include-tags: sync
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Sync e2e tests - iOS 17
- name: Sync e2e tests
uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
ios-version: 17
ios-version: ${{ matrix.os-version }}
workspace: .maestro
include-tags: sync
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}

- name: Create Asana task when workflow failed
if: ${{ failure() }}
run: |
curl -s "https://app.asana.com/api/1.0/tasks" \
--header "Accept: application/json" \
--header "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--data ' { "data": { "name": "GH Workflow Failure - Sync End to end tests", "workspace": "${{ vars.GH_ASANA_WORKSPACE_ID }}", "projects": [ "${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}" } }'
notify-failure:
name: Notify on failure
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
needs: [build-for-sync-end-to-end-tests, sync-end-to-end-tests]
runs-on: ubuntu-latest

- name: Upload logs when workflow failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7
steps:
- name: Create Asana task when workflow failed
run: |
curl -s "https://app.asana.com/api/1.0/tasks" \
--header "Accept: application/json" \
--header "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--data ' { "data": { "name": "GH Workflow Failure - Sync End to end tests", "workspace": "${{ vars.GH_ASANA_WORKSPACE_ID }}", "projects": [ "${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}" } }'




Loading