Skip to content

Commit

Permalink
Merge pull request #352 from WalletConnect/hotfix/ci-improvements
Browse files Browse the repository at this point in the history
[CI] Pipeline improvements develop sync
  • Loading branch information
llbartekll authored Jul 19, 2022
2 parents 7dc7775 + 89c3929 commit 006c214
Show file tree
Hide file tree
Showing 2 changed files with 75 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
55 changes: 15 additions & 40 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ on:
pull_request:
branches: [ main, develop ]

concurrency:
# Support push/pr as event types with different behaviors each:
# 1. push: queue up builds by branch
# 2. pr: only allow one run per PR
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
# If there is already a workflow running for the same pull request, cancel it
# For non-PR triggers queue up builds
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

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 +39,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 006c214

Please sign in to comment.