Skip to content

Add percent progress to event (close #874) #1082

Add percent progress to event (close #874)

Add percent progress to event (close #874) #1082

Workflow file for this run

name: Build
on: [push]
jobs:
podspec:
name: Lint Podspec for ${{ matrix.platform }}
runs-on: macos-13
strategy:
matrix:
platform: [ios, ios, osx, tvos, watchos]
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v3
- name: Lint Podspec
run: pod lib lint --platforms=${{ matrix.platform }}
test_framework:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: "Integration (iOS, Xcode 13.4)"
os: macos-12
xcode-version: 13.4
destination: "platform=iOS Simulator,name=iPhone 13"
target: IntegrationTests
- name: "Unit (iOS, Xcode 13.4)"
os: macos-12
xcode-version: 13.4
destination: "platform=iOS Simulator,name=iPhone 13"
target: Tests
- name: "Unit (macOS, Xcode 13.4)"
os: macos-12
xcode-version: 13.4
destination: "platform=macOS"
target: Tests
- name: "Unit (watchOS, Xcode 13.4)"
os: macos-12
xcode-version: 13.4
destination: "platform=watchOS Simulator,name=Apple Watch Series 7 - 45mm"
target: Tests
- name: "Unit (tvOS, Xcode 13.4)"
os: macos-12
xcode-version: 13.4
destination: "platform=tvOS Simulator,name=Apple TV"
target: Tests
steps:
- name: Checkout
uses: actions/checkout@v3
# -- Micro --
- name: Cache Micro
id: cache-micro
uses: actions/cache@v3
with:
path: micro.jar
key: ${{ runner.os }}-micro
- name: Get micro
if: steps.cache-micro.outputs.cache-hit != 'true' && matrix.target == 'IntegrationTests'
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.7.0/snowplow-micro-1.7.0.jar
- name: Run Micro in background
if: matrix.target == 'IntegrationTests'
run: java -jar micro.jar &
- name: Wait on Micro endpoint
if: matrix.target == 'IntegrationTests'
timeout-minutes: 2
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done
# -- Micro --
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
- name: Build & Test
run: |
set -o pipefail && xcodebuild \
-scheme SnowplowTracker \
-destination "${{ matrix.destination }}" \
-only-testing ${{ matrix.target }} \
-resultBundlePath TestResults \
clean test | xcpretty
- name: Create test results
uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults.xcresult
title: "Test results: ${{ matrix.name }}"
if: success() || failure()
build_objc_demo_app:
name: "ObjC demo (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {
ios: 15.5,
iphone: iPhone 12 Pro,
watchos: 8.5,
watch: Apple Watch Series 5 - 44mm,
macos: "12",
xcode: 13.4,
}
- {
ios: 14.4,
iphone: iPhone 8,
watchos: 7.2,
watch: Apple Watch Series 4 - 40mm,
macos: "11",
xcode: 12.4,
}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowObjCDemo -podfile Podfile -ios "${BUILD_WORKSPACE_OBJC_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_OBJC_DEMO}"
build_swift_cocoapods_demo_app:
name: "Swift demo (Cocoapods) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {
ios: "14.4",
iphone: iPhone 12 Pro,
watchos: "7.2",
watch: Apple Watch Series 5 - 44mm,
macos: "11",
xcode: 12.4,
}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowSwiftCocoapodsDemo -podfile Podfile -ios "${BUILD_WORKSPACE_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" -watch "${BUILD_DEST_PAIRED}" "${BUILD_SCHEME_SWIFT_DEMO_WATCH}"
build_swift_spm_demo_app:
name: "Swift demo (SPM) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {
ios: "14.4",
iphone: iPhone 11 Pro,
watchos: "7.2",
watch: Apple Watch Series 5 - 44mm,
macos: "11",
xcode: 12.4,
}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Get branch name
id: branch
run: |
# Set git branch or git tag as slug
if [[ ${GITHUB_REF} =~ ^refs\/tags\/ ]]; then
GIT_BRANCH=master
else
if [ -n "${GITHUB_HEAD_REF}" ]; then
GIT_BRANCH="${GITHUB_HEAD_REF}"
else
GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
fi
fi
echo ::set-output name=name::${GIT_BRANCH}
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
BRANCH: ${{ steps.branch.outputs.name }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowSwiftSPMDemo -spm ${BRANCH} -ios "${BUILD_WORKSPACE_SWIFT_SPM_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_SPM_DEMO_IOS}"
build_iglu_central_app:
name: "Iglu Central (SPM) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- { ios: 15.5, iphone: iPhone 12 Pro, macos: "12", xcode: 13.4 }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
IPHONE: ${{ matrix.version.iphone }}
BRANCH: ${{ steps.branch.outputs.name }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app IgluCentral -ios "${BUILD_WORKSPACE_IGLU_CENTRAL}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_IGLU_CENTRAL_IOS}"