1111 workflow_dispatch :
1212
1313env :
14- fusionauth-docker-image-version : " 1.53.3 "
14+ fusionauth-docker-image-version : " 1.54.0 "
1515
1616# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717jobs :
@@ -38,27 +38,31 @@ jobs:
3838 xcode : [ "15.4" ]
3939 simulator-platform : [ "iOS" ]
4040 simulator-version : [ "18.1" ]
41- swift : ["5.10.1"]
41+ swift : [ "5.10.1" ]
4242 os : [ "macos-14" ]
43+ postgresql-version : [ "16" ]
4344 include :
4445 - destination : " platform=iOS Simulator,OS=17.5,name=iPhone 15"
4546 xcode : " 15.4"
4647 simulator-platform : " iOS"
4748 simulator-version : " 17.5"
4849 swift : " 5.10.1"
4950 os : " macos-14"
51+ postgresql-version : " 16"
5052 - destination : " platform=iOS Simulator,OS=16.4,name=iPhone 14"
5153 xcode : " 14.3.1"
5254 simulator-platform : " iOS"
5355 simulator-version : " 16.4"
5456 swift : " 5.8.1"
5557 os : " macos-13"
58+ postgresql-version : " 16"
5659 - destination : " platform=iOS Simulator,OS=15.5,name=iPhone 13"
5760 xcode : " 14.3.1"
5861 simulator-platform : " iOS"
5962 simulator-version : " 15.5"
6063 swift : " 5.8.1"
6164 os : " macos-13"
65+ postgresql-version : " 16"
6266
6367 # Steps represent a sequence of tasks that will be executed as part of the job
6468 steps :
@@ -109,6 +113,10 @@ jobs:
109113 - name : Get Swift version
110114 run : swift --version
111115
116+ # Checkout the repository.
117+ - name : Checkout repository
118+ 119+
112120 # Docker deployment is failing because the current macos runner has an M-series processor runner without nested virtualization support.
113121 # Setup Docker on macOS required by FusionAuth.
114122 # - name: Setup Docker on macOS
@@ -132,10 +140,106 @@ jobs:
132140 # brew services start fusionauth-search
133141 # brew services start fusionauth-app
134142
135- # Checkout the repository.
136- - name : Checkout repository
137- 143+ # Install FusionAuth with brew.
144+ - name : Install PostgreSQL
145+ run : brew install postgresql@${{ matrix.postgresql-version }} -v
146+
147+ # Start PostgreSQL with brew.
148+ - name : Start PostgreSQL
149+ run : brew services start postgresql@${{ matrix.postgresql-version }} -v
150+
151+ # Add PostgreSQL to the PATH.
152+ - name : Add PostgreSQL to the PATH
153+ run : echo "$(brew --prefix postgresql@${{matrix.postgresql-version }})/bin" >> $GITHUB_PATH
154+
155+ # Add PostgreSQL fusionauth user with default password.
156+ - name : Add PostgreSQL fusionauth user
157+ run : psql --command="CREATE USER fusionauth PASSWORD 'fusionauth'" --command="\du" postgres
158+
159+ # Add PostgreSQL fusionauth database.
160+ - name : Add PostgreSQL fusionauth database
161+ run : createdb --owner=fusionauth fusionauth
162+
163+ # Tap FusionAuth Homebrew formulae.
164+ - name : Tap FusionAuth Homebrew formulae
165+ run : brew tap sonderformat-llc/fusionauth
166+
167+ # Install FusionAuth Search with brew.
168+ - name : Install FusionAuth Search
169+ run : brew install fusionauth-search -v
170+
171+ # Install FusionAuth App with brew.
172+ - name : Install FusionAuth App
173+ run : brew install fusionauth-app -v
174+
175+ # Configure FusionAuth App with silent mode.
176+ - name : Configure FusionAuth App
177+ run : |
178+ echo "" >> $(brew --prefix)/etc/fusionauth/fusionauth.properties
179+ echo "fusionauth-app.kickstart.file=$(echo $GITHUB_WORKSPACE)/Samples/Quickstart/fusionauth/${{ env.fusionauth-docker-image-version }}/kickstart/kickstart.json" >> $(brew --prefix)/etc/fusionauth/fusionauth.properties
180+ echo "fusionauth-app.silent-mode=true" >> $(brew --prefix)/etc/fusionauth/fusionauth.properties
181+ cat $(brew --prefix)/etc/fusionauth/fusionauth.properties
182+
183+ # Start FusionAuth Search.
184+ - name : Start FusionAuth Search
185+ run : brew services start fusionauth-search -v
186+
187+ # Start FusionAuth App.
188+ - name : Start FusionAuth App
189+ run : brew services start fusionauth-app -v
190+
191+ # Check Brew services status.
192+ - name : Check Brew services status
193+ run : brew services list
194+
195+ # Check FusionAuth status 10 times with increasing wait times
196+ # Continue if FusionAuth status is OK or fail at the end.
197+ - name : Check FusionAuth status
198+ run : |
199+ for i in {1..10}; do
200+ if curl -s http://localhost:9011/api/status | grep -qi "ok"; then
201+ echo "FusionAuth is up and running."
202+ exit 0
203+ else
204+ echo "FusionAuth is not up and running. Waiting for $(expr 10 \* $i) seconds."
205+ sleep $(expr 10 \* $i)
206+ fi
207+ done
208+ cat $(brew --prefix)/var/log/fusionauth/fusionauth-app.log
209+ exit 1
210+
211+ # Check KickstartRunner execution 10 times with increasing wait times
212+ # Continue if KickstartRunner execution is OK or fail at the end.
213+ # TODO - use webhook instead https://fusionauth.io/docs/extend/events-and-webhooks/events/kickstart-success
214+ - name : Check KickstartRunner execution
215+ run : |
216+ for i in {1..10}; do
217+ if cat $(brew --prefix)/var/log/fusionauth/fusionauth-app.log | grep "KickstartRunner" | grep -q "Summary"; then
218+ echo "KickstartRunner execution is OK."
219+ exit 0
220+ else
221+ echo "KickstartRunner execution is not OK. Waiting for $(expr 10 \* $i) seconds."
222+ sleep $(expr 10 \* $i)
223+ fi
224+ done
225+ cat $(brew --prefix)/var/log/fusionauth/fusionauth-app.log
226+ exit 1
227+
228+ # Read FusionAuth App logs.
229+ - name : Read FusionAuth App logs
230+ run : cat $(brew --prefix)/var/log/fusionauth/fusionauth-app.log
231+
232+ # Connect to FusionAuth App.
233+ - name : Connect to FusionAuth App
234+ run : curl http://localhost:9011/api/status
138235
139236 # Perform the tests from the fusionauth-quickstart-swift-ios-native Sample.
140237 - name : Perform end to end tests
141- run : set -o pipefail && xcodebuild -workspace FusionAuthSDK.xcworkspace/ -scheme fusionauth-quickstart-swift-ios-native -destination "${{matrix.destination}}" -skipPackagePluginValidation
238+ run : set -o pipefail && xcodebuild test -workspace FusionAuthSDK.xcworkspace/ -scheme fusionauth-quickstart-swift-ios-native -destination "${{matrix.destination}}" -skipPackagePluginValidation
239+
240+ - name : Upload recording
241+ 242+ if : ${{ failure() }}
243+ with :
244+ name : FusionAuth-${{ matrix.fusionauth-docker-image-version }}_${{ matrix.os }}_xcode-${{ matrix.xcode }}_swift-${{ matrix.swift }}_${{ matrix.simulator-platform }}-${{ matrix.simulator-version }}.xcresult
245+ path : /Users/runner/Library/Developer/Xcode/DerivedData/*/Logs/Test/*.xcresult
0 commit comments