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

FEAT: Separate build/test jobs for integration run/workflow/pipeline #25

Merged
merged 1 commit into from
Jul 27, 2022
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
49 changes: 49 additions & 0 deletions .github/workflows/integration-test-ios-gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: integration-test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: macos-12 # https://github.com/actions/virtual-environments (xcode 13.4.1)
outputs:
artifacts-name: ${{ steps.exec.outputs.artifacts-name }}
artifacts-path: ${{ steps.exec.outputs.artifacts-path }}
steps:
- id: exec
name: Exec
uses: trinhngocthuyen/gh-action-py-exec@main
with:
makefile-target: install test.integration.ios ACTION=build
artifacts-upload-name: build
artifacts-upload-path: examples/ios/DerivedData/Build/Products

test:
runs-on: macos-12
needs: build
strategy:
matrix:
idx: [1, 2]
steps:
- id: exec
name: Exec
uses: trinhngocthuyen/gh-action-py-exec@main
with:
makefile-target: install test.integration.ios ACTION=test
artifacts-download-name: ${{ needs.build.outputs.artifacts-name }}
artifacts-download-path: ${{ needs.build.outputs.artifacts-path }}

coverage:
runs-on: macos-12
needs: test
steps:
- id: exec
name: Exec
uses: trinhngocthuyen/gh-action-py-exec@main
with:
makefile-target: install test.integration.ios ACTION=coverage
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,3 @@ jobs:
with:
files: ./coverage.xml
flags: unittests

integration_test_ios:
runs-on: macos-12 # https://github.com/actions/virtual-environments (xcode 13.4.1)
name: integration-ios
steps:
- name: Exec
uses: trinhngocthuyen/gh-action-py-exec@main
with:
hook-version-file: VERSION
hook-version-suffix: .dev${{ github.run_id }}
makefile-target: install test.integration.ios
35 changes: 27 additions & 8 deletions scripts/integration_test_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@ cd examples/ios
mkdir -p tmp && printf 0 > tmp/test_retries_trace # To simulate test retries

bundle install
bundle exec pod install

python3 -m cicd.ios.build \
--cocoapods \
--derived-data-path DerivedData \
--build-for-testing
python3 -m cicd.ios.test \
--retries 1 \
--derived-data-path DerivedData \
--test-without-building
function _exec_build() {
python3 -m cicd.ios.build \
--derived-data-path DerivedData \
--build-for-testing
}

function _exec_test() {
python3 -m cicd.ios.test \
--retries 1 \
--derived-data-path DerivedData \
--test-without-building
}

function _exec_coverage() {
echo "To be implemented"
}

if [[ -z ${ACTION} ]]; then
actions=(build test coverage)
else
actions=(${ACTION})
fi

for action in ${actions[@]}; do
eval "_exec_${action}"
done