diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2025-05-26 16:28:05 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-05-26 16:28:05 +0200 |
| commit | a0d24f173aa9011056eaa7275a9f21ac4e6817b6 (patch) | |
| tree | 8f353ac2558054cdb230490ef7727de79598bdbf /.github/workflows | |
| parent | a41a136cd715d9eaa96af81bbbebbb5f37c80a25 (diff) | |
| parent | 5861d426bc08c6b3ab643f41ea0d9cc6199a2f81 (diff) | |
| download | mullvadvpn-a0d24f173aa9011056eaa7275a9f21ac4e6817b6.tar.xz mullvadvpn-a0d24f173aa9011056eaa7275a9f21ac4e6817b6.zip | |
Merge branch 'streamline-our-github-actions-and-workflows-to-reduce-ios-1108'
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ios-end-to-end-tests-merge-to-main.yml | 1 | ||||
| -rw-r--r-- | .github/workflows/ios-end-to-end-tests-pr-opened.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/ios-end-to-end-tests.yml | 4 | ||||
| -rw-r--r-- | .github/workflows/ios-screenshots-creation.yml | 27 | ||||
| -rw-r--r-- | .github/workflows/ios-screenshots-tests.yml | 40 | ||||
| -rw-r--r-- | .github/workflows/ios-validate-build-schemas.yml | 47 | ||||
| -rw-r--r-- | .github/workflows/ios.yml | 77 |
7 files changed, 63 insertions, 157 deletions
diff --git a/.github/workflows/ios-end-to-end-tests-merge-to-main.yml b/.github/workflows/ios-end-to-end-tests-merge-to-main.yml index b40c5600e6..34f0d85f84 100644 --- a/.github/workflows/ios-end-to-end-tests-merge-to-main.yml +++ b/.github/workflows/ios-end-to-end-tests-merge-to-main.yml @@ -5,6 +5,7 @@ on: pull_request: types: - closed + - opened branches: - main paths: diff --git a/.github/workflows/ios-end-to-end-tests-pr-opened.yml b/.github/workflows/ios-end-to-end-tests-pr-opened.yml new file mode 100644 index 0000000000..28fd8521e9 --- /dev/null +++ b/.github/workflows/ios-end-to-end-tests-pr-opened.yml @@ -0,0 +1,24 @@ +--- +name: iOS end-to-end on pr opened +on: + workflow_dispatch: + pull_request: + types: + - opened + branches: + - main + paths: + - .github/workflows/ios-end-to-end-tests*.yml + - ios/** + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + reuse-e2e-workflow: + uses: ./.github/workflows/ios-end-to-end-tests.yml + with: + arg_tests_json_key: "pr-opened" + secrets: inherit diff --git a/.github/workflows/ios-end-to-end-tests.yml b/.github/workflows/ios-end-to-end-tests.yml index 496b8bb58c..8c9a8d13d0 100644 --- a/.github/workflows/ios-end-to-end-tests.yml +++ b/.github/workflows/ios-end-to-end-tests.yml @@ -107,7 +107,7 @@ jobs: run: rustup target add aarch64-apple-ios - name: Build iOS end to end tests action - uses: ./.github/actions/build-ios-e2e-tests + uses: ./.github/actions/ios/build-ios-e2e-tests with: test_name: ${{ github.event.inputs.user_supplied_test_name }} ios_device_pin_code: ${{ secrets.IOS_DEVICE_PIN_CODE }} @@ -149,7 +149,7 @@ jobs: test_suite: ${{fromJson(needs.define-test-suites-matrix.outputs.test_suites_json)}} steps: - name: Run iOS end to end tests action - uses: ./.github/actions/run-ios-e2e-tests + uses: ./.github/actions/ios/run-ios-e2e-tests with: test_name: "MullvadVPNUITests/${{ matrix.test_suite }}" test_device_udid: ${{ env.TEST_DEVICE_UDID }} diff --git a/.github/workflows/ios-screenshots-creation.yml b/.github/workflows/ios-screenshots-creation.yml index 289d0278e5..233bb5749d 100644 --- a/.github/workflows/ios-screenshots-creation.yml +++ b/.github/workflows/ios-screenshots-creation.yml @@ -19,30 +19,16 @@ jobs: env: SOURCE_PACKAGES_PATH: .spm TEST_ACCOUNT: ${{ secrets.IOS_TEST_ACCOUNT_NUMBER }} + steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Checkout submodules - run: | - git config --global --add safe.directory '*' - git submodule update --init --recursive ios/wireguard-apple - - - name: Setup go-lang - uses: actions/setup-go@v3 - with: - go-version: 1.21.13 - - - name: Configure Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - name: Configure Rust - run: rustup target add aarch64-apple-ios-sim x86_64-apple-ios + - name: Setup project + uses: ./.github/actions/ios/setup-project-toolchain - - name: Configure Xcode project + - name: Add test account to config run: | - for file in *.xcconfig.template ; do cp $file ${file//.template/} ; done sed -i "" \ "/HAS_TIME_ACCOUNT_NUMBER =/ s#= .*#= 1234123412341234#" \ UITests.xcconfig @@ -52,11 +38,6 @@ jobs: run: bundle install working-directory: ios - - name: Install protobuf - run: | - brew update - brew install protobuf - - name: Create screenshots run: bundle exec fastlane snapshot --cloned_source_packages_path "$SOURCE_PACKAGES_PATH" working-directory: ios diff --git a/.github/workflows/ios-screenshots-tests.yml b/.github/workflows/ios-screenshots-tests.yml index 74589e8f0a..9d007ea634 100644 --- a/.github/workflows/ios-screenshots-tests.yml +++ b/.github/workflows/ios-screenshots-tests.yml @@ -23,38 +23,16 @@ jobs: env: SOURCE_PACKAGES_PATH: .spm TEST_ACCOUNT: ${{ secrets.IOS_TEST_ACCOUNT_NUMBER }} + steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Checkout submodules - run: | - git config --global --add safe.directory '*' - git submodule update --init --recursive ios/wireguard-apple - - - name: Configure cache - uses: actions/cache@v3 - with: - path: ios/${{ env.SOURCE_PACKAGES_PATH }} - key: ${{ runner.os }}-spm-${{ hashFiles('ios/**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-spm- - - - name: Setup go-lang - uses: actions/setup-go@v3 - with: - go-version: 1.21.13 - - - name: Configure Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - name: Configure Rust - run: rustup target add aarch64-apple-ios-sim + - name: Setup project + uses: ./.github/actions/ios/setup-project-toolchain - - name: Configure Xcode project + - name: Add test account to config run: | - for file in *.xcconfig.template ; do cp $file ${file//.template/} ; done sed -i "" \ "/HAS_TIME_ACCOUNT_NUMBER =/ s#= .*#= 1234123412341234#" \ UITests.xcconfig @@ -65,16 +43,6 @@ jobs: brew update brew install zip - - name: Install xcbeautify - run: | - brew update - brew install xcbeautify - - - name: Install protobuf - run: | - brew update - brew install protobuf - - name: Run screenshot tests run: | set -o pipefail && env NSUnbufferedIO=YES xcodebuild \ diff --git a/.github/workflows/ios-validate-build-schemas.yml b/.github/workflows/ios-validate-build-schemas.yml index c73a66d13b..46d87c0077 100644 --- a/.github/workflows/ios-validate-build-schemas.yml +++ b/.github/workflows/ios-validate-build-schemas.yml @@ -24,54 +24,13 @@ jobs: runs-on: macos-15-xlarge env: SOURCE_PACKAGES_PATH: .spm + steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Checkout submodules - run: | - git config --global --add safe.directory '*' - git submodule update --init --recursive ios/wireguard-apple - - - name: Configure cache - uses: actions/cache@v3 - with: - path: ios/${{ env.SOURCE_PACKAGES_PATH }} - key: ${{ runner.os }}-spm-${{ hashFiles('ios/**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-spm- - - - name: Setup go-lang - uses: actions/setup-go@v3 - with: - go-version: 1.21.13 - - - name: Configure Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - name: Configure Rust - run: rustup target add aarch64-apple-ios-sim x86_64-apple-ios - - - name: Configure Xcode project - run: | - cp Base.xcconfig.template Base.xcconfig - cp App.xcconfig.template App.xcconfig - cp PacketTunnel.xcconfig.template PacketTunnel.xcconfig - cp Screenshots.xcconfig.template Screenshots.xcconfig - cp Api.xcconfig.template Api.xcconfig - cp UITests.xcconfig.template UITests.xcconfig - working-directory: ios/Configurations - - - name: Install xcbeautify - run: | - brew update - brew install xcbeautify - - - name: Install protobuf - run: | - brew update - brew install protobuf + - name: Setup project + uses: ./.github/actions/ios/setup-project-toolchain - name: Run build validation for Staging and MockRelease configurations as well as the MullvadVPNUITests target run: | diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 9c0bbc6f01..48184d848d 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -46,68 +46,41 @@ jobs: swiftlint --reporter github-actions-logging working-directory: ios - test: - name: Unit tests - runs-on: macos-15-xlarge + ui-test-build: + name: Build for ui tests (staging) + runs-on: macos-15 env: SOURCE_PACKAGES_PATH: .spm steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Checkout submodules - run: | - git config --global --add safe.directory '*' - git submodule update --init --recursive ios/wireguard-apple - - - - name: Configure cache - uses: actions/cache@v3 - with: - path: ios/${{ env.SOURCE_PACKAGES_PATH }} - key: ${{ runner.os }}-spm-${{ hashFiles('ios/**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-spm- - - - name: Setup go-lang - uses: actions/setup-go@v3 - with: - go-version: 1.21.13 + - name: Setup project + uses: ./.github/actions/ios/setup-project-toolchain - - name: Install xcbeautify + - name: Build for ui tests run: | - brew update - brew install xcbeautify - - - name: Install protobuf - run: | - brew update - brew install protobuf + set -o pipefail && env NSUnbufferedIO=YES xcodebuild \ + -project MullvadVPN.xcodeproj \ + -scheme MullvadVPNUITests \ + -testPlan MullvadVPNUITestsAll \ + -clonedSourcePackagesDirPath "$SOURCE_PACKAGES_PATH" \ + -disableAutomaticPackageResolution \ + -destination "platform=iOS Simulator,name=iPhone 16" \ + clean build-for-testing 2>&1 | xcbeautify + working-directory: ios/ - - name: Configure Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.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 target add aarch64-apple-ios-sim + test: + name: Unit tests + runs-on: macos-15-xlarge + env: + SOURCE_PACKAGES_PATH: .spm + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Configure Xcode project - run: | - cp Base.xcconfig.template Base.xcconfig - cp App.xcconfig.template App.xcconfig - cp PacketTunnel.xcconfig.template PacketTunnel.xcconfig - cp Screenshots.xcconfig.template Screenshots.xcconfig - cp Api.xcconfig.template Api.xcconfig - working-directory: ios/Configurations + - name: Setup project + uses: ./.github/actions/ios/setup-project-toolchain - name: Run unit tests run: | |
