From c3d3d6b709f1148883aa00e2031c8a4be9ae7f16 Mon Sep 17 00:00:00 2001 From: AnwarHussain199 <122963751+AnwarHussain199@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:38:54 +0530 Subject: [PATCH] updated yml to run jobs in parallel --- .github/workflows/CI.yml | 57 +++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 469a568a..ba536664 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,88 +3,85 @@ name: CI Workflow on: [push, pull_request] jobs: - setup-dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '20' - cache: 'npm' - - name: Cache node modules - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - android-build: name: Build for Android runs-on: ubuntu-latest - needs: setup-dependencies steps: - uses: actions/checkout@v2 - - name: Use Node.js (From Cache) + + - name: Use Node.js uses: actions/setup-node@v2 with: node-version: '20' + - name: Set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' distribution: 'adopt' + - name: Set up Android SDK uses: android-actions/setup-android@v2 + + - name: Print Android Environment Info + run: | + echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + echo "ANDROID_HOME=$ANDROID_HOME" + ls -l $ANDROID_HOME || true + ls -l $ANDROID_SDK_ROOT || true + - name: Install Dependencies and Global CLI Tools run: | - npm ci + npm install --force --legacy-peer-deps npm install -g @ionic/cli npm install -g cordova + - name: Install Android SDK Platforms and Tools run: | yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platforms;android-30" "build-tools;30.0.3" + - name: Build Android App run: npm run ionic-e2e:build:android env: ANDROID_SDK_ROOT: ${{ env.ANDROID_HOME }} - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: android-apk - path: platforms/android/app/build/outputs/apk/debug/app-debug.apk build-and-test: name: Build and Test for Web runs-on: ubuntu-latest - needs: setup-dependencies + steps: - uses: actions/checkout@v2 - - name: Use Node.js (From Cache) + + - name: Use Node.js uses: actions/setup-node@v2 with: node-version: '20' + - name: Install Dependencies - run: npm ci + run: npm install --force --legacy-peer-deps + - name: Start Server run: npm start & npx wait-on --timeout 120000 http://localhost:4200/ + - name: Run E2E Tests run: SERVE_PORT=4200 npm run ionic-e2e:run:web + - name: Generate Report run: npm run generate:report if: always() + - name: Upload Allure report uses: actions/upload-artifact@v2 with: name: allure-report path: allure-report if: always() + - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@4.1.4 with: - branch: gh-pages - folder: allure-report + branch: gh-pages # The branch to deploy to + folder: allure-report # The folder containing the report files token: ${{ secrets.GITHUB_TOKEN }} if: always()