Skip to content

Commit

Permalink
Fix the CI pipeline script
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Jul 31, 2024
1 parent 0b111c0 commit 99cd75d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
34 changes: 17 additions & 17 deletions .github/actions/run-ios-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ inputs:
description: 'Test Device UDID'
required: true
outputs_path:
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.'
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.
required: true

runs:
using: 'composite'
steps:
# Set up a unique output directory
# Set up a unique output directory
- name: Set up outputs directory
run: |
if [ -n "$TEST_NAME" ]; then
Expand All @@ -27,7 +29,7 @@ runs:
echo "Setting output directory output"
test_output_directory="${{ env.OUTPUTS_PATH }}/tests-output"
fi
echo "TEST_OUTPUT_DIRECTORY=$test_output_directory" >> $GITHUB_ENV
echo "TEST_NAME_SANITIZED=$test_name_sanitized" >> $GITHUB_ENV
shell: bash
Expand All @@ -42,20 +44,18 @@ runs:
TEST_DEVICE_UDID: ${{ inputs.test_device_udid }}

- name: Run end-to-end-tests
run: |
if [ -n "$TEST_NAME" ]; then
TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME"
else
TEST_NAME_ARGUMENT=""
fi
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \
-project MullvadVPN.xcodeproj \
-scheme MullvadVPNUITests \
-testPlan MullvadVPNUITestsAll $TEST_NAME_ARGUMENT \
-resultBundlePath ${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report \
-derivedDataPath derived-data \
-destination "platform=iOS,id=$TEST_DEVICE_UDID" \
test-without-building 2>&1 #| xcbeautify --report junit --report-path ${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report
run: >
if [ -n "$TEST_NAME" ]; then TEST_NAME_ARGUMENT=" -only-testing $TEST_NAME"; else TEST_NAME_ARGUMENT=""; fi
set -o pipefail && env NSUnbufferedIO=YES xcodebuild
-project MullvadVPN.xcodeproj
-scheme MullvadVPNUITests
-testPlan MullvadVPNUITestsAll $TEST_NAME_ARGUMENT
-resultBundlePath ${{ env.TEST_OUTPUT_DIRECTORY }}/xcode-test-report
-derivedDataPath derived-data
-destination "platform=iOS,id=$TEST_DEVICE_UDID"
test-without-building 2>&1 | xcbeautify --report junit
--report-path ${{ env.TEST_OUTPUT_DIRECTORY }}/junit-test-report
shell: bash
working-directory: ${{ inputs.outputs_path }}/mullvadvpn-app/ios
env:
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ jobs:
with:
go-version: 1.20.14

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

- name: Install xcbeautify
run: |
brew update
brew install xcbeautify
- name: Install protobuf
run: |
brew update
brew install protobuf
- name: Run unit tests
run: |
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \
Expand Down
3 changes: 2 additions & 1 deletion ios/MullvadVPNUITests/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
"AccountTests"
]
}
}
}

0 comments on commit 99cd75d

Please sign in to comment.