forked from gitsachin/ionic-e2e
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9570ec
commit c3d3d6b
Showing
1 changed file
with
27 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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() |