From ed4348829b52840607c0f5372bc213f0d0221813 Mon Sep 17 00:00:00 2001 From: Oleg Gnidets <77254185+oleggnidets-okta@users.noreply.github.com> Date: Thu, 2 Dec 2021 20:39:39 +0200 Subject: [PATCH] Add GitHub Actions (#323) * Add GitHub Actions * Remove .travis.yml and update readme --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ++++++++++++++++ .../pull_request_template.md | 0 .github/workflows/okta-oidc.yml | 35 +++++++++++++++ .travis.yml | 43 ------------------- README.md | 2 +- .../Tasks/OktaOidcBrowserTaskMAC.swift | 1 + 6 files changed, 75 insertions(+), 44 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md rename pull_request_template.md => .github/PULL_REQUEST_TEMPLATE/pull_request_template.md (100%) create mode 100644 .github/workflows/okta-oidc.yml delete mode 100644 .travis.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..dd84ea7824f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md similarity index 100% rename from pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/workflows/okta-oidc.yml b/.github/workflows/okta-oidc.yml new file mode 100644 index 00000000000..98c2166c9b3 --- /dev/null +++ b/.github/workflows/okta-oidc.yml @@ -0,0 +1,35 @@ +name: Okta OIDC iOS + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + UnitTests: + runs-on: macos-11 + env: + DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: iOS + run: set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc-ios" -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" clean test | xcpretty + - name: macOS + run: set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc-mac" -destination "platform=macOS" clean test | xcpretty + - name: Swift + run: swift test -v + UITests: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - name: iOS + run: set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc" -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" clean test | xcpretty + PackageValidation: + runs-on: macos-11 + env: + DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: Cocoapods + run: pod lib lint diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6a01572444..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: objective-c -os: osx -osx_image: xcode12.5 - -jobs: - include: - - stage: Linting - name: SwiftLint - before_install: - brew upgrade swiftlint - script: - - swiftlint version - - swiftlint - - stage: Unit Tests - name: iOS - script: - - set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc-ios" -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" clean test | xcpretty - - stage: Unit Tests - name: MacOS - script: - - set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc-mac" -destination "platform=macOS" clean test | xcpretty - - stage: UI tests - name: iOS - script: - - set -o pipefail && xcodebuild -project okta-oidc.xcodeproj -scheme "okta-oidc" -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" clean test | xcpretty - - stage: Dependency Manager Validation - name: SPM - script: - - swift test - - stage: Dependency Manager Validation - name: CocoaPods - script: - - pod lib lint --allow-warnings - # Takes too much time on CI - # - stage: Dependency Manager Validation - # name: Carthage - # addons: - # homebrew: - # packages: - # - carthage - # update: true - # script: - # - carthage build --use-xcframeworks --no-skip-current diff --git a/README.md b/README.md index 58d5dde0851..6de74137e98 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [](https://devforum.okta.com/) -[![CI Status](http://img.shields.io/travis/okta/okta-oidc-ios.svg?style=flat)](https://travis-ci.com/okta/okta-oidc-ios) +[![CI Status](https://github.com/okta/okta-oidc-ios/actions/workflows/okta-oidc.yml/badge.svg)](https://travis-ci.com/okta/okta-oidc-ios) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](https://img.shields.io/cocoapods/v/OktaOidc.svg?style=flat)](http://cocoapods.org/pods/OktaOidc) [![License](https://img.shields.io/cocoapods/l/OktaOidc.svg?style=flat)](http://cocoapods.org/pods/OktaOidc) diff --git a/Sources/OktaOidc/macOS/Internal/Tasks/OktaOidcBrowserTaskMAC.swift b/Sources/OktaOidc/macOS/Internal/Tasks/OktaOidcBrowserTaskMAC.swift index 59d31270127..e6f54160a19 100644 --- a/Sources/OktaOidc/macOS/Internal/Tasks/OktaOidcBrowserTaskMAC.swift +++ b/Sources/OktaOidc/macOS/Internal/Tasks/OktaOidcBrowserTaskMAC.swift @@ -13,6 +13,7 @@ #if os(macOS) import Foundation +import ApplicationServices #if SWIFT_PACKAGE @testable import OktaOidc_AppAuth