Add ASAN/UBSAN to CI #136
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: Mobile iOS | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-ios: | |
| name: iOS arm64 simulator tests (Nim version-2-2) | |
| runs-on: macos-15 | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Nim | |
| uses: jiro4989/setup-nim-action@v2 | |
| with: | |
| nim-version: "2.2.x" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: nimble install -y --depsOnly | |
| - name: Configure iOS simulator toolchain | |
| run: | | |
| toolchain="$RUNNER_TEMP/ios-toolchain" | |
| mkdir -p "$toolchain" | |
| ln -s "$GITHUB_WORKSPACE/.github/scripts/ios-clang.sh" "$toolchain/clang" | |
| ln -s "$GITHUB_WORKSPACE/.github/scripts/ios-clang.sh" "$toolchain/clang++" | |
| chmod +x "$GITHUB_WORKSPACE/.github/scripts/ios-clang.sh" | |
| echo "IOS_NIM_TOOLCHAIN=$toolchain" >> "$GITHUB_ENV" | |
| echo "IOS_SDK_PATH=$(xcrun --sdk iphonesimulator --show-sdk-path)" >> "$GITHUB_ENV" | |
| echo "NIMFLAGS=--os:ios --cpu:arm64 --cc:clang --clang.path:$toolchain --clang.exe:clang --clang.linkerexe:clang --passC:-D_DARWIN_C_SOURCE" >> "$GITHUB_ENV" | |
| - name: Build and run tests on iOS simulator | |
| env: | |
| NIM_TEST_RUNNER: bash .github/scripts/run-ios-tests.sh | |
| NIM_TEST_SUCCESS_MARKER: build/mobile-tests-passed | |
| run: | | |
| # The marker is written only after every test configuration finishes. | |
| rm -f "$NIM_TEST_SUCCESS_MARKER" | |
| nimble test | |
| test -f "$NIM_TEST_SUCCESS_MARKER" | |
| - name: Shut down simulator | |
| if: always() | |
| run: xcrun simctl shutdown all || true |