-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
195 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Set up environment | ||
description: Set up the environment for building and testing the library on a given platform | ||
|
||
inputs: | ||
xcode: | ||
description: The version of Xcode to use | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Set Ruby version | ||
run: ruby -e 'puts RUBY_VERSION' | tee .ruby-version | ||
shell: bash | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 | ||
with: | ||
bundler-cache: true | ||
cache-version: 1 | ||
|
||
- name: Setup Xcode | ||
uses: mxcl/xcodebuild@6e60022a0cbe8c89278be2dd1773a2f68e7c5c87 | ||
with: | ||
xcode: ${{ inputs.xcode }} | ||
action: none |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run tests | ||
description: Run library tests for a given platform | ||
|
||
inputs: | ||
xcode: | ||
description: The version of Xcode to use | ||
required: true | ||
scheme: | ||
description: The Xcode scheme to use | ||
required: true | ||
platform: | ||
description: The platform to build for | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Install xcpretty | ||
run: gem install xcpretty | ||
shell: bash | ||
|
||
- name: Save Xcode version | ||
run: xcodebuild -version | tee .xcode-version | ||
shell: bash | ||
|
||
- id: restore-carthage-cache | ||
name: Restore Carthage cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: Carthage | ||
key: carthage-${{ inputs.platform }}-${{ hashFiles('Cartfile.resolved') }}-${{ hashFiles('.xcode-version') }}-v1 | ||
|
||
- name: Install dependencies | ||
if: steps.restore-carthage-cache.outputs.cache-hit != 'true' | ||
run: carthage bootstrap --platform ${{ inputs.platform }} --use-xcframeworks --no-use-binaries --cache-builds | ||
shell: bash | ||
|
||
- name: Save Carthage cache | ||
id: save-carthage-cache | ||
uses: actions/cache/save@v3 | ||
if: steps.restore-carthage-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: Carthage | ||
key: carthage-${{ inputs.platform }}-${{ hashFiles('Cartfile.resolved') }}-${{ hashFiles('.xcode-version') }}-v1 | ||
|
||
- name: Run tests | ||
uses: mxcl/xcodebuild@v2 | ||
with: | ||
xcode: ${{ inputs.xcode }} | ||
scheme: ${{ inputs.scheme }} | ||
platform: ${{ inputs.platform }} | ||
code-coverage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,112 @@ | ||
name: Test | ||
on: | ||
[push] | ||
name: CI | ||
on: push | ||
|
||
jobs: | ||
ios: | ||
name: Build and test on iOS | ||
test: | ||
name: Test on ${{ matrix.platform.os }} using Xcode ${{ matrix.xcode }} | ||
runs-on: macos-latest | ||
|
||
env: | ||
xcodeproj: Auth0.xcodeproj | ||
|
||
strategy: | ||
matrix: | ||
platform: | ||
- { os: iOS, scheme: Auth0.iOS } | ||
- { os: macOS, scheme: Auth0.macOS } | ||
- { os: tvOS, scheme: Auth0.tvOS } | ||
xcode: | ||
- '14.2' | ||
|
||
steps: | ||
- uses: ./.github/actions/test | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
with: | ||
xcode: '14.2' | ||
platform: iOS | ||
scheme: Auth0.iOS | ||
xcode: ${{ matrix.xcode }} | ||
|
||
- name: Run tests | ||
uses: ./.github/actions/test | ||
with: | ||
xcode: ${{ matrix.xcode }} | ||
scheme: ${{ matrix.platform.scheme }} | ||
platform: ${{ matrix.platform.os }} | ||
|
||
- name: Convert coverage report | ||
if: ${{ matrix.platform.os == 'iOS' }} | ||
run: bundle exec slather coverage -x --scheme ${{ matrix.platform.scheme }} ${{ env.xcodeproj }} | ||
|
||
- name: Upload coverage report | ||
if: ${{ matrix.platform.os == 'iOS' }} | ||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d | ||
|
||
- name: Cancel wokflow on failure | ||
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1 | ||
if: ${{ failure() }} | ||
|
||
test-package: | ||
name: Test Swift package using Xcode ${{ matrix.xcode }} | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
matrix: | ||
xcode: | ||
- '14.2' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
with: | ||
xcode: ${{ matrix.xcode }} | ||
|
||
- name: Run tests | ||
run: swift test | ||
|
||
- name: Cancel wokflow on failure | ||
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1 | ||
if: ${{ failure() }} | ||
|
||
pod-lint: | ||
name: Lint podspec using Xcode ${{ matrix.xcode }} | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
matrix: | ||
xcode: | ||
- '14.2' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
with: | ||
xcode: ${{ matrix.xcode }} | ||
|
||
- name: Run pod lib lint | ||
run: bundle exec pod lib lint --allow-warnings --fail-fast | ||
|
||
- name: Cancel wokflow on failure | ||
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1 | ||
if: ${{ failure() }} | ||
|
||
swiftlint: | ||
name: Lint code with Swiftlint | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- name: Run Swiftlint | ||
run: swiftlint lint --reporter github-actions-logging | ||
|
||
- name: Cancel wokflow on failure | ||
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1 | ||
if: ${{ failure() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.