[EPAC-2061]: add terraform plan and apply workflows #398
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: PR Build | |
| on: | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: SwiftLint | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/realm/swiftlint:latest | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run SwiftLint | |
| run: swiftlint --reporter github-actions-logging | |
| localization: | |
| name: Localization Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Audit localization coverage | |
| run: python3 scripts/localization/check_localizations.py --github-warnings | |
| build: | |
| name: iOS Build | |
| runs-on: macos-26 | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure git for package resolution | |
| run: | | |
| cat > "$RUNNER_TEMP/ci-gitconfig" <<'EOF' | |
| [url "https://github.com/"] | |
| insteadOf = git@github.com: | |
| insteadOf = ssh://git@github.com/ | |
| insteadOf = git://github.com/ | |
| EOF | |
| echo "GIT_CONFIG_GLOBAL=$RUNNER_TEMP/ci-gitconfig" >> "$GITHUB_ENV" | |
| - name: Build | |
| working-directory: ios | |
| timeout-minutes: 40 | |
| run: | | |
| package_cache="$RUNNER_TEMP/xcode-package-cache" | |
| cloned_packages="$RUNNER_TEMP/xcode-cloned-source-packages" | |
| rm -rf "$package_cache" "$cloned_packages" | |
| mkdir -p "$package_cache" "$cloned_packages" | |
| build_jobs="$(sysctl -n hw.logicalcpu)" | |
| if [ "$build_jobs" -gt 6 ]; then | |
| build_jobs=6 | |
| fi | |
| echo "Using $build_jobs xcodebuild jobs" | |
| heartbeat() { | |
| while true; do | |
| sleep 60 | |
| echo "xcodebuild still running at $(date -u +"%Y-%m-%dT%H:%M:%SZ")" | |
| done | |
| } | |
| heartbeat & | |
| heartbeat_pid=$! | |
| cleanup_heartbeat() { | |
| kill "$heartbeat_pid" 2>/dev/null || true | |
| wait "$heartbeat_pid" 2>/dev/null || true | |
| } | |
| trap cleanup_heartbeat EXIT | |
| xcodebuild build \ | |
| -project epac.xcodeproj \ | |
| -scheme epac \ | |
| -destination "generic/platform=iOS" \ | |
| -derivedDataPath "$GITHUB_WORKSPACE/.deriveddata" \ | |
| -clonedSourcePackagesDirPath "$cloned_packages" \ | |
| -packageCachePath "$package_cache" \ | |
| -disablePackageRepositoryCache \ | |
| -jobs "$build_jobs" \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| GCC_GENERATE_DEBUGGING_SYMBOLS=NO \ | |
| ENABLE_TESTABILITY=NO | |
| pr-build: | |
| name: pr-build | |
| needs: [lint, localization, build] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check required PR gates passed | |
| env: | |
| LINT: ${{ needs.lint.result }} | |
| LOC: ${{ needs.localization.result }} | |
| BUILD: ${{ needs.build.result }} | |
| run: | | |
| if [ "$LINT" != 'success' ]; then | |
| echo "SwiftLint failed (result: $LINT)" | |
| exit 1 | |
| fi | |
| if [ "$LOC" != 'success' ]; then | |
| echo "Localization audit failed (result: $LOC)" | |
| exit 1 | |
| fi | |
| if [ "$BUILD" != 'success' ]; then | |
| echo "iOS build failed (result: $BUILD)" | |
| exit 1 | |
| fi |