Skip to content

Commit 99cd75d

Browse files
committed
Fix the CI pipeline script
1 parent 0b111c0 commit 99cd75d

File tree

3 files changed

+37
-28
lines changed

3 files changed

+37
-28
lines changed

.github/actions/run-ios-e2e-tests/action.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ inputs:
88
description: 'Test Device UDID'
99
required: true
1010
outputs_path:
11-
description: 'Path to where outputs are stored - both build outputs and outputs from running tests. This should be unique for each job run in order to avoid concurrency issues.'
11+
description: >
12+
Path to where outputs are stored - both build outputs and outputs from running tests.
13+
This should be unique for each job run in order to avoid concurrency issues.
1214
required: true
1315

1416
runs:
1517
using: 'composite'
1618
steps:
17-
# Set up a unique output directory
19+
# Set up a unique output directory
1820
- name: Set up outputs directory
1921
run: |
2022
if [ -n "$TEST_NAME" ]; then
@@ -27,7 +29,7 @@ runs:
2729
echo "Setting output directory output"
2830
test_output_directory="${{ env.OUTPUTS_PATH }}/tests-output"
2931
fi
30-
32+
3133
echo "TEST_OUTPUT_DIRECTORY=$test_output_directory" >> $GITHUB_ENV
3234
echo "TEST_NAME_SANITIZED=$test_name_sanitized" >> $GITHUB_ENV
3335
shell: bash
@@ -42,20 +44,18 @@ runs:
4244
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }}
4345

4446
- name: Run end-to-end-tests
45-
run: |
46-
if [ -n "$TEST_NAME" ]; then
47-
TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME"
48-
else
49-
TEST_NAME_ARGUMENT=""
50-
fi
51-
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \
52-
-project MullvadVPN.xcodeproj \
53-
-scheme MullvadVPNUITests \
54-
-testPlan MullvadVPNUITestsAll $TEST_NAME_ARGUMENT \
55-
-resultBundlePath ${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report \
56-
-derivedDataPath derived-data \
57-
-destination "platform=iOS,id=$TEST_DEVICE_UDID" \
58-
test-without-building 2>&1 #| xcbeautify --report junit --report-path ${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report
47+
run: >
48+
if [ -n "$TEST_NAME" ]; then TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME"; else TEST_NAME_ARGUMENT=""; fi
49+
50+
set -o pipefail && env NSUnbufferedIO=YES xcodebuild
51+
-project MullvadVPN.xcodeproj
52+
-scheme MullvadVPNUITests
53+
-testPlan MullvadVPNUITestsAll $TEST_NAME_ARGUMENT
54+
-resultBundlePath ${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report
55+
-derivedDataPath derived-data
56+
-destination "platform=iOS,id=$TEST_DEVICE_UDID"
57+
test-without-building 2>&1 | xcbeautify --report junit
58+
--report-path ${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report
5959
shell: bash
6060
working-directory: ${{ inputs.outputs_path }}/mullvadvpn-app/ios
6161
env:

.github/workflows/ios.yml

+18-10
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ jobs:
6464
with:
6565
go-version: 1.20.14
6666

67+
- name: Install xcbeautify
68+
run: |
69+
brew update
70+
brew install xcbeautify
71+
72+
- name: Install protobuf
73+
run: |
74+
brew update
75+
brew install protobuf
76+
6777
- name: Set up yeetd to workaround XCode being slow in CI
6878
run: |
6979
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
@@ -74,7 +84,15 @@ jobs:
7484
with:
7585
xcode-version: '15.0.1'
7686
- name: Configure Rust
87+
# Since the https://github.com/actions/runner-images/releases/tag/macos-13-arm64%2F20240721.1 release
88+
# Brew does not install tools at the correct location anymore
89+
# This update broke the rust build script which was assuming the cargo binary was located in ~/.cargo/bin/cargo
90+
# The workaround is to fix brew paths by running brew bundle dump, and then brew bundle
91+
# WARNING: This has to be the last brew "upgrade" commands that is ran,
92+
# otherwise the brew path will be broken again.
7793
run: |
94+
brew bundle dump
95+
brew bundle
7896
rustup default stable
7997
rustup update stable
8098
rustup target add aarch64-apple-ios-sim
@@ -88,16 +106,6 @@ jobs:
88106
cp Api.xcconfig.template Api.xcconfig
89107
working-directory: ios/Configurations
90108

91-
- name: Install xcbeautify
92-
run: |
93-
brew update
94-
brew install xcbeautify
95-
96-
- name: Install protobuf
97-
run: |
98-
brew update
99-
brew install protobuf
100-
101109
- name: Run unit tests
102110
run: |
103111
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \

ios/MullvadVPNUITests/tests.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
"AccountTests"
1616
]
1717
}
18-
}
18+
}
19+

0 commit comments

Comments
 (0)