Mgration iOS to SPM #1976
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: CI | |
| # This workflow is triggered on every push. | |
| # It runs the backend and frontend tests and uploads the coverage to Codecov. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| backend-and-frontend-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - name: Setup node | |
| uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: IsraelHiking.Web/.nvmrc | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v6.0.0 | |
| with: | |
| dotnet-version: '10.0' | |
| - name: Run backend tests | |
| run: dotnet test Tests/IsraelHiking.API.Tests --logger "junit;LogFilePath=test-result.xml" /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:Exclude="[IsraelHiking.Common]*" | |
| - name: Run frontend tests | |
| run: | | |
| cd IsraelHiking.Web | |
| npm ci | |
| npx playwright install --with-deps chromium | |
| npm run test-ci | |
| - name: Run lint | |
| run: | | |
| cd IsraelHiking.Web | |
| npx ng lint | |
| - name: Codecov upload | |
| if: always() | |
| uses: codecov/codecov-action@v7.0.0 | |
| with: | |
| files: ./Tests/IsraelHiking.API.Tests/coverage.info,./IsraelHiking.Web/coverage/lcov.info | |
| env: | |
| CODECOV_TOKEN: fc1bea1d-f43a-437e-84d3-baef07be7454 | |
| build-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - name: Setup node | |
| uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: IsraelHiking.Web/.nvmrc | |
| - name: Setup Java | |
| uses: actions/setup-java@v5.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4.1' | |
| working-directory: IsraelHiking.Web/android | |
| bundler-cache: true | |
| - name: Build UI and set version | |
| run: | | |
| cd IsraelHiking.Web | |
| npm ci | |
| npm run build:mobile -- --no-progress | |
| npx cap sync android | |
| - name: Build Android Release | |
| if: ${{ github.secret_source == 'Actions' }} | |
| run: | | |
| cd IsraelHiking.Web/android | |
| bundle exec fastlane build_aab | |
| env: | |
| STORE_PASSWORD: ${{ secrets.MAPEAK_STORE_PASSWORD }} | |
| PASSWORD: ${{ secrets.MAPEAK_PASSWORD }} | |
| KEYSTORE_PATH: ${{ github.workspace }}/IsraelHiking.Web/android/app/Mapeak.jks | |
| - name: Upload aab artifacts | |
| if: ${{ github.secret_source == 'Actions' }} | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: Mapeak_signed_${{ needs.version.outputs.version_string }}.aab | |
| path: IsraelHiking.Web/android/app/build/outputs/bundle/release/app-release.aab | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - name: Build Docker image | |
| run: | | |
| docker build . -t ghcr.io/israelhikingmap/website-mapeak | |
| build-ios: | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7.0.1 | |
| - name: Setup node | |
| uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: IsraelHiking.Web/.nvmrc | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4.1' | |
| working-directory: IsraelHiking.Web/ios/App | |
| bundler-cache: true | |
| - name: Set up Git to use PAT for private match repo | |
| run: | | |
| git config --global url."https://x-access-token:${{ secrets.FASTLANE_MATCH_PAT }}@github.com/IsraelHikingMap/fastlane-match".insteadOf "https://github.com/IsraelHikingMap/fastlane-match" | |
| - name: Build UI | |
| run: | | |
| cd IsraelHiking.Web | |
| npm ci | |
| npm run build:mobile -- --no-progress | |
| npx cap sync ios | |
| # The cloned packages and their binary artifacts are ~250MB of prebuilt | |
| # xcframeworks. Restore and save are split rather than using actions/cache, | |
| # which only saves when the whole job succeeds - the cache should persist even | |
| # if the build step later fails. | |
| - name: Restore Swift package cache | |
| id: spm-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: IsraelHiking.Web/ios/.spm-cache | |
| key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} | |
| restore-keys: spm-${{ runner.os }}- | |
| # Resolve up front. Left to fastlane, this download happens inside | |
| # xcodebuild -showBuildSettings, whose output fastlane captures - so it is | |
| # invisible and trips the build-settings timeout. Must run after `npm ci`, since | |
| # the plugin packages are path references into node_modules. | |
| - name: Resolve Swift packages | |
| timeout-minutes: 20 | |
| run: | | |
| cd IsraelHiking.Web/ios/App | |
| time xcodebuild -resolvePackageDependencies \ | |
| -project App.xcodeproj \ | |
| -clonedSourcePackagesDirPath ../.spm-cache | |
| du -sh ../.spm-cache ../.spm-cache/artifacts | |
| - name: Save Swift package cache | |
| if: steps.spm-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: IsraelHiking.Web/ios/.spm-cache | |
| key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} | |
| - name: Build iOS with signing | |
| if: ${{ github.secret_source == 'Actions' }} | |
| timeout-minutes: 25 | |
| run: | | |
| cd IsraelHiking.Web/ios/App | |
| bundle exec fastlane build_ios | |
| env: | |
| MATCH_PASSWORD: ${{ secrets.PASSWORD }} | |
| - name: Upload ipa artifacts | |
| if: ${{ github.secret_source == 'Actions' }} | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: Mapeak_signed_${{ needs.version.outputs.version_string }}.ipa | |
| path: IsraelHiking.Web/ios/App/App.ipa |