Skip to content

Commit

Permalink
Merge pull request #344 from WalletConnect/derek/feat/parallelize
Browse files Browse the repository at this point in the history
feat: parallelizes build
  • Loading branch information
arein authored Jul 15, 2022
2 parents 6e89bf7 + 9fd64db commit b0ae511
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 40 deletions.
60 changes: 60 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 'ci'
description: 'Executes Swift specific CI steps'
inputs:
type:
description: 'The type of CI step to run'
required: true

runs:
using: "composite"
steps:
# Package builds
- name: Run tests
if: inputs.type == 'unit-tests'
shell: bash
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme WalletConnect \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# Integration tests
- name: Run integration tests
if: inputs.type == 'integration-tests'
shell: bash
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme IntegrationTests \
-clonedSourcePackagesDirPath SourcePackages \
-destination 'platform=iOS Simulator,name=iPhone 13' test"

# Wallet build
- name: Build Example Wallet
if: inputs.type == 'build-example-wallet'
shell: bash
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme Wallet \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# DApp build
- name: Build Example Dapp
if: inputs.type == 'build-example-dapp'
shell: bash
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme DApp \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# UI tests
- name: UI Tests
if: inputs.type == 'ui-tests'
shell: bash
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme UITests \
-clonedSourcePackagesDirPath SourcePackages \
-destination 'platform=iOS Simulator,name=iPhone 13' test"
continue-on-error: true
46 changes: 6 additions & 40 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
test-type: [unit-tests, integration-tests, build-example-wallet, build-example-dapp, ui-tests]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,43 +30,6 @@ jobs:
restore-keys: |
${{ runner.os }}-spm-
# Package builds
- name: Run tests
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme WalletConnect \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# Integration tests
- name: Run integration tests
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme IntegrationTests \
-clonedSourcePackagesDirPath SourcePackages \
-destination 'platform=iOS Simulator,name=iPhone 13' test"

# Wallet build
- name: Build Example Wallet
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme Wallet \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# DApp build
- name: Build Example Dapp
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme DApp \
-clonedSourcePackagesDirPath SourcePackages \
-sdk iphonesimulator"

# UI tests
- name: UI Tests
run: "xcodebuild \
-project Example/ExampleApp.xcodeproj \
-scheme UITests \
-clonedSourcePackagesDirPath SourcePackages \
-destination 'platform=iOS Simulator,name=iPhone 13' test"
continue-on-error: true
- uses: ./.github/actions/ci
with:
type: ${{ matrix.test-type }}

0 comments on commit b0ae511

Please sign in to comment.