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

Sabrina/sync e2e ci #1990

Closed
wants to merge 18 commits into from
118 changes: 118 additions & 0 deletions .github/workflows/Sync-End-to-End-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: sync-end-to-end-tests

on:
push:
branches: [ main, "release/**" ]
pull_request:
workflow_call:
inputs:
branch:
description: "Branch name"
required: false
type: string
secrets:
ASANA_ACCESS_TOKEN:
required: true

jobs:


test:
runs-on: macos-13-xlarge
steps:
- name: Check out the code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache."
fi

- name: Cache SPM
if: env.cache_key_hash
uses: actions/cache@v3
with:
path: DerivedData/SourcePackages
key: ${{ runner.os }}-spm-${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- name: Install xcbeautify
continue-on-error: true
run: |
if ! command -v xcbeautify &> /dev/null; then
brew install xcbeautify
fi

- 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: Build and run Sync e2e test 1
run: |
set -o pipefail && xcodebuild test \
-scheme "Sync End-to-End UI Tests" \
-configuration "CI" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
| tee xcodebuild.log \
| xcbeautify

# - name: Run clean-app.sh review
# run: |
# ./clean-app.sh review
#
# - name: Build and run Sync e2e test 2
# run: |
# set -o pipefail && xcodebuild test \
# -scheme "Sync End-to-End UI Tests" \
# -configuration "CI" \
# -derivedDataPath "DerivedData" \
# -only-testing:CriticalPathsTests/testCanRecoverSyncAccount \
# | tee xcodebuild.log \
# | xcbeautify
#
# - name: Run clean-app.sh review
# run: |
# ./clean-app.sh review
#
# - name: Build and run Sync e2e test 3
# env:
# CODE: ${{ steps.sync-recovery-code.outputs.recovery-code }}
# run: |
# set -o pipefail && xcodebuild test \
# -scheme "Sync End-to-End UI Tests" \
# -configuration "CI" \
# -derivedDataPath "DerivedData" \
# -only-testing:CriticalPathsTests/testCanLoginToExistingSyncAccount \
# | tee xcodebuild.log \
# | xcbeautify
#
# - name: Run clean-app.sh review
# run: |
# ./clean-app.sh review
#
# - name: Build and run Sync e2e test 4
# env:
# CODE: ${{ steps.sync-recovery-code.outputs.recovery-code }}
# run: |
# set -o pipefail && xcodebuild test \
# -scheme "Sync End-to-End UI Tests" \
# -configuration "CI" \
# -derivedDataPath "DerivedData" \
# -only-testing:CriticalPathsTests/testCanSyncData \
# | tee xcodebuild.log \
# | xcbeautify


Loading