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 29, 2024
1 parent 447458b commit 1047d7d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 29 deletions.
36 changes: 20 additions & 16 deletions .github/actions/run-ios-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ 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:
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,22 @@ 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: >
echo "$(cat $0)"
echo "Get relieved on"
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
41 changes: 28 additions & 13 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
detached: true

- name: Configure cache
uses: actions/cache@v3
with:
Expand All @@ -59,10 +66,20 @@ jobs:
restore-keys: |
${{ runner.os }}-spm-
# Do not use the github actions to install go, it will not install the correct version
- name: Setup go-lang
uses: actions/setup-go@v3
with:
go-version: 1.20.14
run: |
brew install [email protected]
- 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: |
Expand All @@ -74,7 +91,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 +113,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

0 comments on commit 1047d7d

Please sign in to comment.