feat: add app hang reporting #1947
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ios | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| # Cancel in-progress CI jobs when a new commit is pushed to a PR. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| pre_check: | |
| name: pre_check | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.check_changes.outputs.run_tests }} | |
| steps: | |
| # Checkout repo to Github Actions runner | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for Bazel build file changes | |
| id: bazel_check | |
| run: | | |
| ./ci/check_bazel.sh //examples/swift:ios_app //platform/swift //test/platform/swift | |
| continue-on-error: true | |
| - name: Check for workflow file changes | |
| id: workflow_check | |
| run: | | |
| ./ci/files_changed.sh .github/workflows/ios.yaml | |
| continue-on-error: true | |
| - name: Determine if tests should run | |
| id: check_changes_separate | |
| run: | | |
| bazel_status="${{ steps.bazel_check.outputs.check_result }}" | |
| workflow_status="${{ steps.workflow_check.outputs.check_result }}" | |
| # Log the values of bazel_status and workflow_status for diagnostics | |
| echo "bazel_status: $bazel_status" | |
| echo "workflow_status: $workflow_status" | |
| # Check if any status indicates a relevant change or error | |
| if [[ "$bazel_status" == "1" || "$workflow_status" == "1" ]]; then | |
| echo "An unexpected issue occurred during checks." | |
| exit 1 | |
| elif [[ "$bazel_status" == "0" || "$workflow_status" == "0" ]]; then | |
| echo "Changes detected in one or more checks. Running tests." | |
| echo "run_tests=true" >> $GITHUB_ENV | |
| elif [[ "$bazel_status" == "2" && "$workflow_status" == "2" ]]; then | |
| echo "No relevant changes found." | |
| echo "run_tests=false" >> $GITHUB_ENV | |
| else | |
| echo "Unknown issue." | |
| exit 1 | |
| fi | |
| shell: bash | |
| - name: Run downstream tests if changes are detected | |
| id: check_changes | |
| if: env.run_tests == 'true' | |
| run: ./ci/run_tests.sh | |
| swift_hello_world: | |
| name: swift_hello_world | |
| timeout-minutes: 40 | |
| needs: "pre_check" | |
| if: needs.pre_check.outputs.should_run == 'true' | |
| runs-on: macos-15 | |
| steps: | |
| # Checkout repo to Github Actions runner | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: "Install dependencies" | |
| run: ./ci/mac_ci_setup.sh | |
| - run: ./bazelw build --config ci //examples/swift/hello_world:ios_app | |
| name: "Build app" | |
| # TODO(snowp): Add some kind of assertion that the app does that it's supposed to | |
| - run: ./bazelw run --config ci //examples/swift/hello_world:ios_app &> /tmp/envoy.log & | |
| name: "Run app" | |
| macos_tsan: | |
| runs-on: macos-15 | |
| needs: "pre_check" | |
| if: needs.pre_check.outputs.should_run == 'true' | |
| steps: | |
| # Checkout repo to Github Actions runner | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: "Install dependencies" | |
| run: ./ci/mac_ci_setup.sh | |
| - name: Run iOS tests (tsan) | |
| run: env -u ANDROID_NDK_HOME ./bazelw test $(./bazelw query 'kind(ios_unit_test, //test/platform/swift/unit_integration/core/...)') --test_tag_filters=macos_only --test_output=errors --config ci --config ios-tsan | |
| verify_ios: | |
| runs-on: ubuntu-latest | |
| needs: ["macos_tsan", "swift_hello_world"] | |
| if: always() | |
| steps: | |
| # Checkout repo to Github Actions runner | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - run: | | |
| ./ci/check_result.sh ${{ needs.macos_tsan.result }} \ | |
| && ./ci/check_result.sh ${{ needs.swift_hello_world.result }} |