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

Configure Github Actions to Build and Run Tests #75

Merged
merged 1 commit into from
May 3, 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
22 changes: 22 additions & 0 deletions .github/actions/build-for-testing/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build For Testing
inputs:
scheme:
description: Scheme
required: true
destination:
description: Destination
required: true
runs:
using: composite
steps:
- shell: bash
working-directory: .
run: |
xcodebuild clean build-for-testing \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-scheme '${{ inputs.scheme }}' \
-destination '${{ inputs.destination }}' \
-resultBundlePath BuildResults.xcresult
rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8
7 changes: 7 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Install Dependencies
runs:
using: composite
steps:
- shell: bash
run: |
brew install gnu-sed automake gcc autoconf libtool
36 changes: 36 additions & 0 deletions .github/actions/test-without-building/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test Without Building
inputs:
scheme:
description: Scheme
required: true
destination:
description: Destination
required: true
test-plan:
description: Test Plan
required: false
artifact-prefix:
description: The prefix for the filename of the uploaded xcresults file
required: true
check-name:
description: The check name
required: true
runs:
using: composite
steps:
- shell: bash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- shell: bash
working-directory: .
run: |
xcodebuild test-without-building \
-scheme '${{ inputs.scheme }}' \
-destination '${{ inputs.destination }}' \
-resultBundlePath "${{ inputs.artifact-prefix }}-${{ steps.vars.outputs.sha_short }}.xcresult"
- uses: kishikawakatsumi/xcresulttool@v1
if: always()
with:
path: ./${{ inputs.artifact-prefix }}-${{ steps.vars.outputs.sha_short }}.xcresult
title: ${{ inputs.check-name }}
show-passed-tests: false
67 changes: 67 additions & 0 deletions .github/workflows/build-frameworks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Frameworks
permissions:
contents: read
statuses: read
pull-requests: read
actions: read
checks: write
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
name: Build (${{ matrix.configuration['platform'] }})
runs-on: macos-12
strategy:
fail-fast: false
matrix:
configuration:
- scheme: LibWally
destination: generic/platform=iOS
platform: iOS
sdk-name: iphoneos
- scheme: LibWally
destination: platform=iOS Simulator,OS=15.2,name=iPhone 13 Pro
platform: iOS Simulator
sdk-name: iphonesimulator
xcode-unit-test: LibWallyTests
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
steps:
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
- name: Build
id: build
uses: ./.github/actions/build-for-testing
with:
scheme: ${{ matrix.configuration['scheme'] }}
destination: ${{ matrix.configuration['destination'] }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: config-log
path: CLibWally/libwally-core/config.log
- name: Xcode Unit Test
if: ${{ matrix.configuration['xcode-unit-test'] != '' }}
continue-on-error: true
uses: ./.github/actions/test-without-building
with:
scheme: ${{ matrix.configuration['scheme'] }}
destination: ${{ matrix.configuration['destination'] }}
test-plan: ${{ matrix.configuration['xcode-unit-test'] }}
artifact-prefix: unit-tests-${{ matrix.configuration['sdk-name'] }}
check-name: Xcode Unit Tests (${{ matrix.configuration['platform'] }})