E2E Test with latest FusionAuth #51
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 workflow performs a full End 2 End test of the App | |
# It runs the test on the last 5 iOS releases. | |
name: E2E Test with latest FusionAuth | |
on: | |
# Triggers the workflow on pull request events but only for default and protected branches | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
fusionauth-docker-image-version: "1.53.3" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "e2e-test" | |
e2e-test: | |
name: End 2 End Test | |
permissions: | |
# required for all workflows | |
security-events: write | |
# only required for workflows in private repositories | |
actions: read | |
contents: read | |
# The type of runner that the job will run on | |
# https://xcodereleases.com/ | |
# https://developer.apple.com/support/xcode/ | |
# https://developer.apple.com/documentation/xcode-release-notes | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
destination: [ "platform=iOS Simulator,OS=18.1,name=iPhone 15" ] | |
xcode: [ "15.4" ] | |
simulator-platform: [ "iOS" ] | |
simulator-version: [ "18.1" ] | |
swift: ["5.10.1"] | |
os: [ "macos-14" ] | |
include: | |
- destination: "platform=iOS Simulator,OS=17.5,name=iPhone 15" | |
xcode: "15.4" | |
simulator-platform: "iOS" | |
simulator-version: "17.5" | |
swift: "5.10.1" | |
os: "macos-14" | |
- destination: "platform=iOS Simulator,OS=16.4,name=iPhone 14" | |
xcode: "14.3.1" | |
simulator-platform: "iOS" | |
simulator-version: "16.4" | |
swift: "5.8.1" | |
os: "macos-13" | |
- destination: "platform=iOS Simulator,OS=15.5,name=iPhone 13" | |
xcode: "14.3.1" | |
simulator-platform: "iOS" | |
simulator-version: "15.5" | |
swift: "5.8.1" | |
os: "macos-13" | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Initialize the latest version of Xcode. | |
- name: Initialize latest xcode | |
uses: maxim-lobanov/[email protected] | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
# Remove any other Xcode version. | |
- name: Remove old xcode versions | |
run: | | |
echo "Searching for Xcode versions:" | |
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 | |
echo "Removing old Xcode versions..." | |
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 | grep -v ${{ matrix.xcode }} | xargs rm -rf | |
echo "Available Xcode versions after removal:" | |
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 | |
# Get the Xcode version. | |
- name: Get Xcode version | |
run: xcodebuild -version | |
# Install Xcodes. | |
- name: Install Xcodes | |
if: matrix.os == 'macos-13' | |
shell: bash | |
run: | | |
brew install aria2 | |
brew install xcodes | |
# Install simulator platform. | |
- name: Install Simulator | |
if: matrix.os == 'macos-13' | |
shell: bash | |
run: | | |
sudo xcodes runtimes | |
sudo xcodes runtimes install '${{ matrix.simulator-platform }} ${{ matrix.simulator-version }}' | |
sudo xcodes runtimes | |
# Initialize Swift in the matrix specified version. | |
- name: Initialize Swift | |
uses: swift-actions/[email protected] | |
with: | |
swift-version: ${{ matrix.swift }} | |
# Get the Swift version. | |
- name: Get Swift version | |
run: swift --version | |
# Docker deployment is failing because the current macos runner has an M-series processor runner without nested virtualization support. | |
# Setup Docker on macOS required by FusionAuth. | |
#- name: Setup Docker on macOS | |
# uses: douglascamata/setup-docker-macos-action@v1-alpha | |
# Create and start FusionAuth containers used by E2E test. | |
#- name: Start FusionAuth | |
# uses: fusionauth/fusionauth-github-action@v1 | |
# with: | |
# FUSIONAUTH_VERSION: ${{ env.fusionauth-docker-image-version }} | |
# FUSIONAUTH_APP_KICKSTART_DIRECTORY_PATH: Samples/Quickstart/fusionauth/${{ env.fusionauth-docker-image-version }}/kickstart | |
# FusionAuth deployment fails https://github.com/FusionAuth/homebrew-fusionauth/issues/9 | |
# Install FusionAuth with brew. | |
#- name: Install FusionAuth | |
# env: | |
# FUSIONAUTH_APP_KICKSTART_FILE: "Samples/Quickstart/fusionauth/${{ env.fusionauth-docker-image-version }}/kickstart/kickstart.json" | |
# run: | | |
# brew tap fusionauth/homebrew-fusionauth | |
# brew install fusionauth-app fusionauth-search | |
# brew services start fusionauth-search | |
# brew services start fusionauth-app | |
# Checkout the repository. | |
- name: Checkout repository | |
uses: actions/[email protected] | |
# Perform the tests from the fusionauth-quickstart-swift-ios-native Sample. | |
- name: Perform end to end tests | |
run: set -o pipefail && xcodebuild -workspace FusionAuthSDK.xcworkspace/ -scheme fusionauth-quickstart-swift-ios-native -destination "${{matrix.destination}}" -skipPackagePluginValidation |